Firedac ArrayDML Crazy ?

Firedac ArrayDML Crazy ?

Hi Guys. I´m having a estrange behavior using firedac and arrayDML for insertions.

See this code:

    cArray.CommandText.Text :=
      'insert into processo_estagio(idprocesso, estagio)' +
      ' values (:idprocesso, :estagio) on duplicate key update estagio=:estagio';


          ...
          cArray.Params[0].AsIntegers[fArrayIDX] := 3319;
          cArray.Params[1].AsIntegers[fArrayIDX] := 2;
         ...
cArray is a tfdcommand.
In the Firedac Monitor, I m having this result for the generated SQL:

mysql_real_query [q="insert into processo_estagio(idprocesso, estagio) values (3319, 2), (2, 3319) on duplicate key update estagio=2

Firedac is inverting the parameters orders.

But, If I run the array with arraysize = 1 (one by one), this error not
occurs.

Anyone have informations about what is it ?

Comments

  1. Does the same happen if you name your params differently from the field names?

    ReplyDelete
  2. Yes, Lars Fosdal . Using different names or using parambyname instead of params[], the behavior is the same.

    ReplyDelete

Post a Comment