on serverside I have a SQL-Servertable, with 5000 blobs:
SQLServerTable:
ID: Integer
Pic: VarBinary
In my Firemonkey IOS App I have SDAC-Client and LiteDAC client.
SQLIteTable:
ID: Integer
Pic: VarBinary
I can connect via network to the SQLServerTable and want to copy the data to my local SQLiteTable.
What is the best way to copy the data?
Case 1:
Code: Select all
SQLServerTable : TMSQuery;
SQLiteTable : TLiteQuery;
SQLServerTable.SQL.Text := 'select ID, Pic from SQLServerTable';
SQLServerTable.open;
SQLiteTable.SQL.Text := 'select ID, Pic from SQLiteTable';
SQLiteTable.open;
while not SQLServerTable.eof do begin
SQLiteTable.Insert;
SQLiteTable.FieldByName('ID').Value := SQServerTable.FieldByName('ID').Value;
SQLiteTable.Post;
SQLServerTable.next;
end;
SQLiteTable.Close;
SQLServerTable.Close;
Case 2:
Code: Select all
SQLServerTable : TMSQuery;
SQLiteScript : TLiteScript;
SQLServerTable.SQL.Text := 'select ID, Pic from SQLServerTable';
SQLServerTable.open;
SQLiteScript.SQL.Text := 'insert into SQLiteTable (ID, PIC) values (:ID, :PIC)';
while not SQLServerTable.eof do begin
SQLiteScript.ParamByName('ID').Value := SQServerTable.FieldByName('ID').Value;
SQLiteScript.ParamByName('PIC').Value := SQServerTable.FieldByName('PIC').Value;
SQLiteScript.Execute;
SQLServerTable.next;
end;
SQLServerTable.Close;
Case 2 doesn't work, the Pics are NOT copied!
Thanks in advance,
Dietrich