SQLite Forum

Confused about sqlite3_step / sqlite_reset / sqlite3_bind_xxx APIs
Login
Given that you are using SQLite in different ways for different parts of your program, I'm not going to discuss the different behaviours you'll see at different points.  Instead, I'll give you some guidelines.

Use <code>sqlite3_reset()</code> too much rather than too little.  It won't do any harm.  Also, it doesn't clear existing bindings.  Use it if you're going to reuse a statement after <code>sqlite3_step()</code> returned <code>SQLITE_DONE</code>.  You should expect to use either <code>sqlite3_reset()</code> or <code>sqlite3_finalize()</code> on every statement before your program closes a connection.

When checking the value returned by <code>sqlite3_reset()</code>, you should get <code>SQLITE_OK</code>.  Other values probably indicate errors.