Hi, apologies if this is a trivial question, but I'm a newbie to sqlite3. (very impressed so far)
I want to search two tables which should contain the same records and add any that are missing from the second into the first. So I do SELECT * FROM table1 LEFT JOIN table2 on table1.field=table2.field WHERE table2.field is NULL So far, so good, I get the records I want. Then in the callback, I try INSERT INTO table1 etc... This fails with a "database table is locked" error. I'm assuming that this is because I'm still in the middle of doing the SELECT statement. So my question is this, do I have to use the callback to copy the records into a temp table, and then only add them after the sqlite3_exec() which calls the SELECT has returned? or is there a more elegant/obvious solution? Any pointers most welcome Rachel