Hello,

Thanks for your prompt reply!
Then, should sqlite3_finalize be called for a sqlite3_stmt pointer before it
gets prepared for another sql statement? in another word, can the same
sqlite3_stmt pointer get prepared multiple times and executed afterwards
without a sqlite3_finalize in between?

string sql;
sqlite3_stmt *stmt;

sql="select ... ";
sqlite3_prepare(...sql.c_str()...stmt...);
sqlite3_step(stmt);

sqlite3_finalize(stmt); // Is this needed ??

sql="delete ... ";
sqlite3_prepare(...sql.c_str()...stmt...);
sqlite3_step(stmt);

Br,Kai


On 6/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

"Kai Wu" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> sqltie3_stmt *stmt;
> sqlite3_prepare(...stmt...);
> sqlite3_reset(stmt);
> sqlite3_reset(stmt); // Is this OK?
>

This is OK.

A statement is created by sqlite3_prepare and
is destroyed by sqlite3_finalize.  sqlite3_reset
can be called as many times as you like in between.
--
D. Richard Hipp   <[EMAIL PROTECTED]>


Reply via email to