Does "insert" in SQLite return SQLITE_OK or SQLITE_DONE? -
What is the "insert" statement in SQLite's return in case of success?
I always believed that SQLITE_DONE should be, but recently I got the following string in my logs:
sqlite3_step error: 'no error' / Code> And here is the code that logs the following string:
prepared statement (adtonslationTMT2, "Include in translations (lang1_wordid, lang2_wordid) VALUES ( ?,?) "); If (AddTranslationStmt2) returns -2; Sqlite3_bind_int (addTranslationStmt2, 1, word_id); Sqlite3_bind_int (Additional translation STM2, 2, translation_ID); If (sqlite3_step (addTranslationStmt2)! = SQLITE_DONE) {NSLog (@ "sqlite3_step error: '% s'", sqlite3_errmsg (database)); Sqlite3_reset (addTranslationStmt2); Return -1; } Sqlite3_reset (addTranslationStmt2);
I wonder, why does this work in most cases should I change SQLITE_DONE to SQLITE_OK in my code?
Thank you.
SQLITE_DONE
You can also try to print the error code for.
Comments
Post a Comment