How to use multiple SQLite databases

I have 2 databases, one downloaded from the client server [server.db], and one used as storage on the client [client.db]. I want to perform queries on the client database, using data from the server database.

For example, I want to delete all rows in the client.db tRole table, and repopulate with all rows in the server.db tRole table.

example- 2, I want to delete all rows in the [client.db] tFile table where the fileID is not in the [server.db] tFile table.

In SQL Server you can just prefix the table with the name of the database. Is there anyway to do this in SQLite using Adobe Air?

There is a  attach method on SQLConnection . This is for what you are trying. 

 

var connection : SQLConnection = new SQLConnection();
connection.open(firstDbFile);
connection.attach(secondDbFile, "otherDb");
var statement : SQLStatement = new SQLStatement();

statement.connection = connection;
statement.text = "INSERT INTO main.myTable SELECT * FROM otherDb.myTable";
statement.execute();

 

Hope this full fill your requirment .  

There is a  attach method in SQLConnection . This is for what you are trying. 

 

var connection : SQLConnection = new SQLConnection();
connection.open(firstDbFile);
connection.attach(secondDbFile, "otherDb");
var statement : SQLStatement = new SQLStatement();

statement.connection = connection;
statement.text = "INSERT INTO main.myTable SELECT * FROM otherDb.myTable";
statement.execute();

 

Hope this full fill your requirment .