> -----Original Message-----
> From: Jay Sprenkle [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 23, 2006 10:55 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] "SQL logic error or missing database"
> 
> On 5/23/06, Robert Simpson <[EMAIL PROTECTED]> wrote:
> > After sqlite3_step() fails, you should call sqlite3_reset() on the 
> > statement.  This is what will give you the SQLITE_SCHEMA error, 
> > indicating you need to re-prepare your statement.
> 
> 
> That doesn't seem right.
> The change was made and committed then the database statement 
> prepared.
> The change should have already been written so the prepare 
> should have gotten the latest stuff. Does it need to be 
> closed and reopened for a schema change to be recognized?=

Beats me, but that's the way it seems to work.  You should always reset() a
statement after a failed step(), and check the reset()'s error code to see
if it's SQLITE_SCHEMA.  If it is, you should re-prepare the statement.  I
don't think it matters when the statement was prepare()'d as long as you
follow that rule.

Robert


Reply via email to