SQLite 3 Duplicate key error

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
jjeffman
Senior Boarder
Senior Boarder
Posts: 56
Joined: 25.08.2005, 12:40
Location: Porto Alegre

SQLite 3 Duplicate key error

Post by jjeffman »

Is there a way of checking if the SQL error is a duplicate key error ?

Thank you very much.
Jayme Jeffman Filho

DBA, Software Engineer
Sul Engenharia e Sistema Ltda

http://www.sulenge.com.br
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

jjeffman,

i'm sorry again. I don't think this is possible because SQLite doesn't provide any Error-Messages and the Result-Codes are less usefull in this case: http://www.sqlite.org/c3ref/c_abort.html

We can only handle/process what we see or getting returned.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
jjeffman
Senior Boarder
Senior Boarder
Posts: 56
Joined: 25.08.2005, 12:40
Location: Porto Alegre

Post by jjeffman »

Thank you very much.

The application can survive without the error discretization, although it could be better if I it would be possible.

Kind regards.
Jayme Jeffman Filho

DBA, Software Engineer
Sul Engenharia e Sistema Ltda

http://www.sulenge.com.br
jjeffman
Senior Boarder
Senior Boarder
Posts: 56
Joined: 25.08.2005, 12:40
Location: Porto Alegre

Post by jjeffman »

Looking to the error code list ( 29 different codes ) I have found the SQLITE_CONSTRAINT error, which I think may be used to catch attempts to insert rows with the same key value because it will result in a constraint violation, a primary key or unique constraint.

Thank you very much for point me to the error code list.

Kind regards
Jayme Jeffman Filho

DBA, Software Engineer
Sul Engenharia e Sistema Ltda

http://www.sulenge.com.br
Post Reply