Attempting to attach the database to the currently open database, but I get an error: ATTACH is not allowed from SQL

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

+3
source share
1 answer

From Adobe LiveDocs :

The following SQL elements and SQLite functions are supported in some SQLite implementations, but are not supported in Adobe AIR. Most of this functionality is available through the methods of the SQLConnection class:

* ATTACH: This functionality is available through the 
  SQLConnection.attach() method.
+5
source

Source: https://habr.com/ru/post/1702445/


All Articles