Jonathan Kahn <[EMAIL PROTECTED]>
wrote:
 If I prepare a statement can I bind variables as my value and then
set the variables in a loop and execute?  Or in my loop would I bind
my values and step so each bind gets executed until it equals
SQLITE_DONE then reset?  I guess I am just unclear on how to execute
my prepared statement and set my values in a loop.

You have to bind all parameters after sqlite3_prepare or sqlite3_reset calls, and before making the first sqlite3_step call. Once you call step, you can't change parameters until you call reset. Usually you would call step in a loop until it retuns SQLITE_DONE, but it's not mandatory (you can stop early). Once you are done processing the results, call sqlite_reset to make the statement ready for new execution, or call sqlite3_finalize to destroy the statement.

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to