Alan Chandler <a...@chandlerfamily.org.uk> wrote:
> The first time round the loop seems to work fine, but the second time
> round the loop, the $astmt->execute(); trying to attach to the file
> fails with SQLITE_SCHEMA

Any query that changes the schema of the database invalidates all prepared 
statements. ATTACH is one of such queries.

> Reading the docs, it appears SQLITE_SCHEMA means I need to recompile the
> prepared statement each time round the loop.
> 
> (I tried it and it works - but is inefficient).

Very likely immeasurably small compared to the cost of actually executing 
ATTACH, let alone the code behind "..." in your example.
-- 
Igor Tandetnik


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to