Page 1 of 1

update multiple records with different values in MySQL

Posted: Wed 26 Mar 2008 13:10
by stevenhanz
(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?

Posted: Wed 26 Mar 2008 13:50
by Dimon
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.

Posted: Wed 26 Mar 2008 16:52
by stevenhanz
thank you