Database table transfer over TCP
Unsolved
General and Desktop
-
@DoughBoy
The following SQL, with the Chinook test database open will create a new file in the same directory named 'out.sqlite' holding all of the album information for artist 51 with the original table layout.A Qt model is totally unnecessary. Just run the query and it will create your file. From there you can compress it and ship it.
ATTACH DATABASE 'out.sqlite' AS outdb; CREATE TABLE outdb.album AS SELECT * from album WHERE ArtistId = 51; DETACH DATABASE outdb;
It does use SQLite specific sql.
Note especially that the ATTACH DATABASE and DETACH DATABASE are sql to be sent to the database just like the CREATE TABLE..
BTW, I have never done this using Qt, only in batch files, but I see no reason for it not to work both ways.
Mike