Tim Streater <t...@clothears.org.uk> wrote: > I'm using the PDO interface in PHP and what I do is ($dbh is a handle to the > source database): > > $dbh->query ("attach database ':memory:' as mem"); > $dbh->query ($create_messages); // Create the messages table in > the memory database > $dbh->query ("attach database '" . $mailbox . "' as dst"); > $dbh->query ("insert into mem.messages select * from main.messages where > absid='$absid'"); // *** The failing statement ***
I'm not familiar with PDO and PHP, but my educated guess is, the language binding layer running on top of SQLite has cached the prepared INSERT statement from prior execution. But that statement's handle has been invalidated by intervening ATTACH statements (see http://www.sqlite.org/c3ref/prepare.html , in particular the difference between sqlite3_prepare and sqlite3_prepare_v2). See if there's any way to instruct the binding to clear its cache of prepared statements. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users