Trying to run a query on the B4XTable memory DB and move the resulting data directly to a table in the main SQLite (file based) table.
I trying to do this by attaching the B4XTable memory DB to the main DB and then running that query from the main DB.
The reason for doing it like this is that the normal way (moving the data via a list and setting the data with B4XTable SetData) can be problematic
with a large data amount of data.
Attaching the memory database to the main database works fine (checked with PRAGMA database_list, run from the main DB), but the query to move
the data fails with this error:
net.sqlcipher.database.SQLiteException: no such table: mem_19.data: insert into GAC select c2, count(*) as cnt from mem_19.data group by c2 order by cnt asc
GAC (group and count) is the table in the main DB and mem_19 is the name given to the attached memory DB.
19 is the B4XTable Tag.
Running select c2, count(*) as cnt from data group by c2 order by cnt asc the normal way (not attaching the memory DB) works all fine.
My question is if anybody has been able to do the above, so attaching the B4XTable memory DB to a file based DB and move data across via SQL.
If so, I would be very interested how it was done.
RBS
I trying to do this by attaching the B4XTable memory DB to the main DB and then running that query from the main DB.
The reason for doing it like this is that the normal way (moving the data via a list and setting the data with B4XTable SetData) can be problematic
with a large data amount of data.
Attaching the memory database to the main database works fine (checked with PRAGMA database_list, run from the main DB), but the query to move
the data fails with this error:
net.sqlcipher.database.SQLiteException: no such table: mem_19.data: insert into GAC select c2, count(*) as cnt from mem_19.data group by c2 order by cnt asc
GAC (group and count) is the table in the main DB and mem_19 is the name given to the attached memory DB.
19 is the B4XTable Tag.
Running select c2, count(*) as cnt from data group by c2 order by cnt asc the normal way (not attaching the memory DB) works all fine.
My question is if anybody has been able to do the above, so attaching the B4XTable memory DB to a file based DB and move data across via SQL.
If so, I would be very interested how it was done.
RBS