ESQLiteError "constraint failed"

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
skippy
Posts: 20
Joined: Fri 18 Sep 2009 09:42

ESQLiteError "constraint failed"

Post by skippy » Tue 03 Nov 2009 22:58

Hi,

using SQLite with UniDAC I always get an exception "constraint failed" at any point in time, can't really find out where exactly, or under which circumstances.

Anyone having an idea ?

Thanks

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 04 Nov 2009 10:38

You may get this error if you insert records with duplicate primary key values.

skippy
Posts: 20
Joined: Fri 18 Sep 2009 09:42

Post by skippy » Wed 04 Nov 2009 15:12

But the Primary Key Value is the AutoIncrement ID:

[ID] INTEGER PRIMARY KEY AUTOINCREMENT,

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 06 Nov 2009 12:27

Check what other constranits your table has. It could be UNIQUE or CHECK constraints.

skippy
Posts: 20
Joined: Fri 18 Sep 2009 09:42

Post by skippy » Sun 29 Nov 2009 10:37

Yes, there was another unique index, I was first looking in an older version of the table... :(
Thanks for the hint and *this DB component is really great*

Rgds

Post Reply