Your calling sequence should be

- sqlite3_prepare() or sqlite3_prepare_v2()
- sqlite3_bind_xxx() if you have any parameters
- sqlite3_step()
- sqlite3_reset() or sqlite3_finalize() depending on if you want to run the 
statement again or not

You need to *check* the return status of *every* call.

Probably you are ignoring SQLITE_ERROR from your sqlite3_step() call.

-----Urspr?ngliche Nachricht-----
Von: Bart Smissaert [mailto:bart.smissaert at gmail.com]
Gesendet: Dienstag, 17. M?rz 2015 19:19
An: General Discussion of SQLite Database
Betreff: [sqlite] result of sqlite3_finalize zero, but sqlite3_errcode produces 
(rightly) SQLITE_CONSTRAINT

Have a simple table with a primary integer key.
Doing an insert (with no insert or ignore or insert or replace) with duplicate 
values for this primary integer key field produces zero on sqlite3_finalize, but
19 from sqlite3_errorcode.
I thought that the result value of sqlite3_finalize also should produce a 
non-zero value.
This is with the latest version.
Anything I am overlooking here or misunderstanding?

RBS
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


Reply via email to