Dear Master,
Need help, I have table in mysql which has 978.828 records. When I try this script, the process is very slow (the application like hang up)
zsqlprocessor1.Clear;
zsqlprocessor1.Script.Text := 'update tbharga Set HARGA="' + inttostr(Harga) + '" where NamaRs="' + RS + '" && KODEPRODUK="' + KodeProduk + '"';
zsqlprocessor1.Execute;
How to resolve this case? because when I try to reduce the record, the process running smoothly and faster. Waiting for your reply
Regards
Bagus
SQLProcessor slow when handle thousand record
Moderators: gto, EgonHugeist
Just a little question : why don't you use a ZQuery ? Try this perhaps
ZQuery := TZQuery;
Zquery := TZQuery.create(nil);
Zquery.SQL.Clear;
ZQuery.SQL.Add('update tbharga Set HARGA= :Harga where NamaRs=' + RS + ' && KODEPRODUK=' + KodeProduk );
ZQuery.OaralNyName ('Harga').AsInteger := Harga;
ZQuery.Active := true;
ZQuery := TZQuery;
Zquery := TZQuery.create(nil);
Zquery.SQL.Clear;
ZQuery.SQL.Add('update tbharga Set HARGA= :Harga where NamaRs=' + RS + ' && KODEPRODUK=' + KodeProduk );
ZQuery.OaralNyName ('Harga').AsInteger := Harga;
ZQuery.Active := true;
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
bgzretry,
did you tried a prepared Statement too?
Var
PrepStatement: IZPreparedStatement;
begin
PrepStatement := ZConnection.DbcConnection.PrepareStatement('update tbharga Set HARGA= :Harga where NamaRs=' + RS + ' && KODEPRODUK=' + KodeProduk ');
PrepStatement.Prepare;
PrepStatement.SetInt(0, Harga);
for I := 1 to Your.Count-1 do
begin
PrepStatement.SetInt(0, Harga);
....
end;
You can also use Batch-scripts with a TIntegerDynArray.
You can find all definitions in the ZDbcIntfs.pas
best regards
did you tried a prepared Statement too?
Var
PrepStatement: IZPreparedStatement;
begin
PrepStatement := ZConnection.DbcConnection.PrepareStatement('update tbharga Set HARGA= :Harga where NamaRs=' + RS + ' && KODEPRODUK=' + KodeProduk ');
PrepStatement.Prepare;
PrepStatement.SetInt(0, Harga);
for I := 1 to Your.Count-1 do
begin
PrepStatement.SetInt(0, Harga);
....
end;
You can also use Batch-scripts with a TIntegerDynArray.
You can find all definitions in the ZDbcIntfs.pas
best regards
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/