On 5/23/06, Robert Simpson <[EMAIL PROTECTED]> wrote:
> 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.
It was prepared after the schema was changed and written to disk.
That seems pretty unintuitive to me. When you prepare the statement
it evidently doesn't use the current schema, though it knows the schema
has changed...
I guess that implies the call to reset() reloads the schema
I'll check that