> You can execute only 1 statement at a time in SQLDB.
>
> So you should change:
>
>      for i:= 0 to 100 do //if i comment this line it works
>        Sql.Add('insert into test (AInt, AFloat, AStr) values 
> ('+IntToStr(i)+', 2.1 , ''AText'');');
>
> to
>     with FDataSet do
>      begin
>      Database:=FConnection;
>      Transaction:=FTransaction;
>      ParseSQL:=True;
>      ReadOnly:=False;
>      FTransaction.StartTransaction;
>      for i:= 0 to 100 do //if i comment this line it works
>        begin
>        Sql.Text:='insert into test (AInt, AFloat, AStr) values 
> ('+IntToStr(i)+', 2.1 , ''AText'')';
>        ExecSql;
>        end;
>      FTransaction.Commit;
>      end;
>
> I use a similar routine to execute 600.000 statements and it definitely works 
> OK :-)
>
> Michael.

Thank you. It works.

Luiz


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to