Pyramide-Ingenierie Developer List <[EMAIL PROTECTED]> wrote:
I try to compile only once an SQL instruction like "INSERT INTO Book (author_fk,title,date,time,price,created) VALUES (?,?,?,?,?,?);" and insert multiple rows through a (sqlite3_bind_xxx / sqlite3_bind_step) loop but I everytime got errors...
We do it all the time. What errors are you getting?
Does looping through step is only available for "SELECT" ?
Well, "looping" is only meaningful for SELECT as it's the only statement that can produce one or more rows. Other kinds of queries are executed with a single call to sqlite3_step which returns SQLITE_DONE.
Cannot we think that a compiled SQL statement could be reuse many times as long as only the bindings change ?
Quite.
I try to use "sqlite3_reset()" and/or "sqlite3_clear_bindings()" before "re-binds" and "re-step" but I always get an error 21 (SQLITE_MISUSE) when I am calling them on a already used sqlite3_stmt...
sqlite3_reset should work. You are doing something wrong. Show a small complete sample that reproduces the problem.
Igor Tandetnik
----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------