如果成功,sqlite中的“insert”语句会返回什么?
我一直认为它应该是sqlITE_DONE,但最近在我的日志中我发现了以下字符串:
sqlite3_step error: 'not an error'
以下是记录上述字符串的代码:
prepareStatement(addTranslationStmt2,"INSERT INTO translations(lang1_wordid,lang2_wordid) VALUES(?,?)"); if (!addTranslationStmt2) return -2; sqlite3_bind_int(addTranslationStmt2,1,word_id); sqlite3_bind_int(addTranslationStmt2,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);
我想知道,为什么它在大多数情况下都有效.
我应该将代码中的sqlITE_DONE更改为sqlITE_OK吗?
谢谢.