Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Import extremly slow, Array DML



Permlink Replies: 0
Andrea Kaiser

Posts: 63
Registered: 11/17/15
Import extremly slow, Array DML
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 26, 2015 1:26 AM
Attachment TestDML.zip (1,001.5 KB)
see https://forums.embarcadero.com/thread.jspa?threadID=119270&tstart=0

I made a little test application. MySQL driver 5.5.10 (libmysql.dll) is included.

The main part is:

 
procedure TMainForm.DmlBtnClick(Sender: TObject);
var i : integer;
 
 
        (* Start DML *)
        procedure StartDML;
        begin
            with FDQuery1 do begin
              ResourceOptions.ArrayDMLSize := 10000;
              Connection.ResourceOptions.ArrayDMLSize := 10000;
              Params.ArraySize := 10000;
              SQL.Text := 'INSERT INTO Stonibud VALUES (:f1, :f2, :f3)';
            end;
        end;
 
 
        (* Write record in DML *)
        procedure WriteDML (RecNr, FldNr : integer; Value : string);
        begin
            FDQuery1.Params[FldNr].AsStrings[RecNr] := Value;
        end;
 
 
        (* Execute DML *)
        procedure ExecDML;
        begin
            FDQuery1.Execute;
        end;
 
begin
    StartDML;
    for i := 0 to 100 do begin
      WriteDML(i, 0, IntToStr(i+1));              <--- Error on second run
      WriteDML(i, 1, IntToStr(Random(100)));
      WriteDML(i, 2, 'Qualcosa');
    end;
    ExecDML;
end;


At the point, when trying to prepare the second record, the error [FireDAC][Stan]-707 appears:
"[FireDAC][Stan]-707. Parameter value is out of range (Parameter: [FIELD1, Index: [1], Range [0.0])"

Thanks for looking into this!

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02