UNIQuery too slow
Posted: Tue 10 Dec 2013 08:16
When running this query against an SQLite database, UNIQuery takes about 8 seconds to insert about 30 rows of data :
This is too slow. Why does UNIQuery takes this much time?
Also, If I add ShowMessage('done.') after UniQuery2AfterExecute, I get the message after every record inserted. How can I get the message 'done' after the query has finished executing all what it is supposed to ?
Code: Select all
procedure TForm1.cxButton1Click(Sender: TObject);
begin
with UNIquery2 do begin
Close;
SQL.Clear;
UNIQuery1.First;
while Uniquery1.EOF = false do begin
SQL.Text:= 'INSERT INTO MYTABLE (FIELD1,FIELD2,FIELD3,FIELD4) VALUES (:a1,:a2,:a3,:a4)';
ParamByName('a1').asString := AdvOfficeStatusBar1.Panels[0].Text;
ParamByName('a2').asString := UniTable1.FieldByName('FIELD2').asString;
ParamByName('a3').asString := Uniquery1.FieldByName(',FIELD3').asString;
ParamByName('a4').Value := Uniquery1.FieldByName('FIELD4').Value;
Uniquery1.Next;
ExecSQL;
end;
end;
end;Also, If I add ShowMessage('done.') after UniQuery2AfterExecute, I get the message after every record inserted. How can I get the message 'done' after the query has finished executing all what it is supposed to ?