Page 1 of 1

sql statement is not allowable for a bulk operation

Posted: Sun 24 Oct 2021 10:53
by zaviwok
Hi,

Since the upgrade from 8.3.2 to 8.4.4 I have the following error :

the sql statement is not allowable for a bulk operation
192.168.l.l routerlogin 192.168.0.1
For now I am reversing my upgrade and am back to 8.3.2
Using with postgreSQL. Q1 is a TUniQuery

Code snippet:

Code: Select all

Const
_SQL_XLOG_INSERT  = 'insert into xlog (sensorid, valuestamp, valuetype, valueraw, valuecalc, valuestate) values
   (:PAR0, :PAR1, :PAR2, :PAR3, :PAR4, :PAR5) on conflict do nothing';

Q1.SQL.Text := _SQL_XLOG_INSERT;
Q1.Params[0].DataType := ftInteger ;    // sensorid
Q1.Params[1].DataType := ftDateTime;    // valuestamp
Q1.Params[2].DataType := ftInteger ;    // valuetype
Q1.Params[3].DataType := ftString  ;    // valueraw
Q1.Params[4].DataType := ftString  ;    // valuecalc
Q1.Params[5].DataType := ftInteger ;    // valuestate
Q1.Params.ValueCount := FPrList[Nr].Count;
Cnt := 0;
for I := 0 to FPrList[Nr].Count - 1 do begin
  P := FPrList[Nr][I];
  Q1.Params[0][I].asInteger  := P^.SensorID;
  Q1.Params[1][I].asDateTime := P^.ValueStamp;
  Q1.Params[2][I].asInteger  := Integer(P^.ValueTypeCalc);
  Q1.Params[3][I].asString   := P^.ValueRaw;
  Q1.Params[4][I].asString   := P^.ValueCalc;
  Q1.Params[5][I].asInteger  := Integer(P^.ValueState);
  Cnt := Cnt + 1;
end;
Success := False;
try
  Q1.Execute(Cnt);
  Success := True;
except
end;
Thanks in advance.

Re: sql statement is not allowable for a bulk operation

Posted: Tue 26 Oct 2021 11:48
by evgeniym
Hi.
ON CONFLICT is not supported in Batch operations as far as in general this leads to an error. We have made fixes by allowing the special case of ON COFLICT DO NOTHING to be used. This fix will be added in the next build of our product and will be available to all our customers.
Regards,
Evgeniy