i'm using Unidac to connect to FireBird.
i want to import other data from text to Firebird database, about 100k records.
If use normal way it same too slow
i current using
for I := 0 to recordcount do
begin
UniQuery1.SQL.Text:= (sqlstr);
UniQuery1.Execute;
end;
Is there other way to do it faster .?
Thank
Fast way to insert 100k records to Firebird
Try to use a SQL statement with parameters:
Code: Select all
UniQuery1.SQL.Text := 'INSERT INTO Table1(a, b) VALUES (:a, :b)';
UniQuery1.ParamByName('a').DataType := ftInteger;
UniQuery1.ParamByName('b').DataType := ftString;
UniQuery1.Prepare;
for I := 0 to recordcount do
begin
UniQuery1.ParamByName('a').Value := I;
UniQuery1.ParamByName('b').Value := I;
UniQuery1.Execute;
end;
UniQuery1.Unprepare;