SQLite Forum

multiple queries
Login
sqlite3_step does not use sqlite3_complete nor does it parse anything.

sqlite3_step causes the VDBE program created by sqlite3_prepare* to execute to the point at which the next row of output is available, or the execution of the program completes -- or perhaps returns an error if the program execution detects an error condition.

sqlite3_prepare_v2 is the thing which parses SQL statements and outputs VDBE programs to be executed by sqlite3_step.  It returns it own error returns indicating if a problem was detected in preparation of the VDBE program.

They are quite separate and distinct things.  If sqlite3_prepare_v2 returns an error, then you have nought to be executing so the question is like saying "so if the house falls down then the store was out of green paint".  It rests on a false premise.

It is hard to tell if your real underlying problem is merely a failure to check error returns because you appear to be getting to somewhere that should be impossible for a rational person to get to -- or you are continually mistaking sqlite3_step for sqlite3_prepare_v2 -- and it is very difficult to tell what your problem is because of that.