DAC for MySQL
TMySQLTable.Properties.BatchModify | Previous Next |
Batch insert, update and delete records.
Syntax:
property BatchModify: Boolean;
Description:
If you want implement batch Insert, Delete or Update operations, we suggest
you to use BatchModify property.
This property allows you increase operation speed. When you set BatchModify to
True, DAC for MySQL doesn't fetch data from database after each Insert or Update
operations.
 | Use TMySQLQuery for batch Insert, Update or Delete operations. |
Example:
procedure TForm1.Button1Click(Sender: TObject);
var
I : Integer;
begin
MySQLTable1.BatchModify := True;
MySQLTable1.DisableControls;
for I := 1 to 1000 do
begin
MySQLTable1.Insert;
MySQLTable1.FieldByName('ID').AsInteger := I;
MySQLTable1.FieldByName('Name').AsString := 'name'+IntToStr(I);
MySQLTable1.Post;
end;
MySQLTable1.BatchModify := False;
MySQLTable1.EnableControls;
end;