I am trying to attach a database (db2.sqlite) to the currently open database (db1.sqlite) and copy the contents of one of the tables in db2 to one of the tables in db1. In a logical way to do this, I thought that I needed to use the attach command, and then select everything from db2 and paste it into db1: -
attach 'C: \ db2.sqlite' as newData; insert in main.table1 select * from newData.table1
Both databases have the same table names (table1) and the same schema. To make sure my syntax is correct, I tried this in Firefox SQLite Manager and everything worked perfectly.
Unfortunately, when I tried the same method in my application, I received the following error: "ATTACH is not allowed from SQL.", Operation: "execute", detailID: "2053" "
Can anyone tell me why this is not working?
Many thanks Adam
Adam mccrossan
source
share