nbiggs <[EMAIL PROTECTED]> wrote:
Can somebody please explain the difference between the
sqlite3_finalize and sqlite3_reset functions.

sqlite3_finalize destroys the statement handle and all internal structures associated with it. The handle is unusable after that.

sqlite3_reset clears the information related to the query now in progress, but does not destroy the statement. You can now run another query using the same statement, perhaps after binding different parameters. You must call sqlite3_reset between two queries that use the same statement.

Do I just call finalize after calling prepare and step, or do I need
to call reset also?

No need to call reset before finalize, if you are done with the statement. You only need to call sqlite3_reset if you want to reuse the statement for further queries.

Igor Tandetnik

Reply via email to