Tags down


Using multiple SQLite databases at once

By : user80495
Date : July 29 2020, 05:00 AM
will help you I just looked at the AIR SQL API, and there's an attach method on SQLConnection it looks exactly what you need.
I haven't tested this, but according to the documentation it should work:
code :
var connection : SQLConnection = new SQLConnection();

connection.attach(secondDbFile, "otherDb");

var statement : SQLStatement = new SQLStatement();

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

Share : facebook icon twitter icon

Sqlite view across multiple databases

By : shuaib wasif khan
Date : March 29 2020, 07:55 AM
this will help Is it possible to create a VIEW (not temporary view) in a Sqlite database that has other databases attached to it? The view should be able to access data from all databases via joined tables. , No, the view must be temporary, otherwise an error will occur:
code :
sqlite> create view view1 as select * from db2.foo union select * from main.foo;
Error: view view1 cannot reference objects in database db2
sqlite> create temp view view1 as select * from db2.foo union select * from main.foo;
sqlite> select * from view1;
sqlite> .headers on
sqlite> select * from sqlite_temp_master;
view|view1|view1|0|CREATE VIEW view1 as select * from db2.foo union select * from main.foo
select * from sqlite_temp_master where type='view';

How to select all columns from multiple SQLite databases

By : raju j
Date : March 29 2020, 07:55 AM
it helps some times In case you have not solved this already, this will work:
a) dbOne.execute("SELECT * FROM db2.myTable");

Accepted methodology when using multiple Sqlite databases

By : user3518286
Date : March 29 2020, 07:55 AM
it fixes the issue So, as an answer:
on the master db, store an extra id field identifying the source/collection database that the dataset was collected on, as well as the tree id.

Update from multiple databases in SQLite

By : user3634024
Date : March 29 2020, 07:55 AM
may help you . I have two tables in two different databases. I'd like to update column data in db1 with column data in db2 based on id. db1 contains less rows than db2, so I do not want to copy over the whole table. I only want to update the data column of the already existing rows in db1. , With db1 open, try this:
code :
ATTACH 'path/to/db2' AS db2;
UPDATE main.table
SET data = (SELECT data FROM db2.table WHERE main.table.id = db2.table.id)
WHERE EXISTS(SELECT 1 FROM db2.table WHERE main.table.id = db2.table.id);

SQLite view across multiple databases. Is this okay? Is there a better way?

By : WithNeo
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further Question 1: What are the downsides?
You have to update the view EVERY. FISCAL. year.
Related Posts Related Posts :
Privacy Policy - Terms - Contact Us © voile276.org