update multiple records with different values in MySQL

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
stevenhanz
Posts: 3
Joined: Wed 26 Mar 2008 12:48

update multiple records with different values in MySQL

Post by stevenhanz » Wed 26 Mar 2008 13:10

(delphi 2006)
I want to update multiple records (e.g. 10000 rows) , each of which has different values.

In the ODAC for Oracle it is possible like that:
{
OraSql : TOraSql;

OraSQL.sql.text := 'update Roads set E1 = :p1 where ID = :p2';
OraSQL.prepare;

OraSQL.Params.items[1].Itemasinteger[counter] := IntArray[0];
OraSQL.Params.items[0].ItemasFloat[counter] := DataArray[0];

inc(counter);
if counter > 10000 then OraSQL.exeute(10000);
}

Is there a component in MyDAC that I can have the same function?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 26 Mar 2008 13:50

In ODAC this possibility is supported by Oracle server. MySQL does not support such functionality. Therefore in MyDAC you should use cycle to update multiple records.

stevenhanz
Posts: 3
Joined: Wed 26 Mar 2008 12:48

Post by stevenhanz » Wed 26 Mar 2008 16:52

thank you

Post Reply