Hello,
Le 22-nov.-06 à 21:08, Igor Tandetnik a écrit :
Pyramide-Ingenierie Developer List
<[EMAIL PROTECTED]> wrote:
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.
In fact, when I only use sqlite3_reset() before making the new binds
to insert a new row, I don't get any error from sqlite3_reset() but I
get a SQLITE_RANGE error at the first sqlite3_bind_xxx call I make
(see the sequence of sqlite3_calls() below)... As if I had to "clear
the bindings" made for the first "insert"...
There is something wrong with your indexes. Show some code.
You don't need sqlite3_clear_bindings, though the call is harmless.
You can bind the same parameter multiple times - the newer binding
simply overwrites the older. You must indeed call sqlite3_reset
after you call sqlite3_step and before you can rebind parameters.
Igor Tandetnik
You perfectly right ! I do not sleep enough (you didn't say it but it
is) !
I was well calling "sqlite3_reset", resetting the status that prevent
me to call "sqlite3_step" after the last row has been fetched but I
completely forgot to reset the binding index, so it was starting at "N
+1" at the second row ! So why the SQLITE_RANGE error...
Thanks for your help and for the interesting mail thread pointed out
by Dennis Cote...
Luc Demarche