sql statement is not allowable for a bulk operation

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zaviwok
Posts: 1
Joined: Sun 24 Oct 2021 10:46

sql statement is not allowable for a bulk operation

Post by zaviwok » Sun 24 Oct 2021 10:53

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.
Last edited by zaviwok on Fri 12 Nov 2021 22:27, edited 1 time in total.

evgeniym
Devart Team
Posts: 103
Joined: Thu 13 May 2021 07:08

Re: sql statement is not allowable for a bulk operation

Post by evgeniym » Tue 26 Oct 2021 11:48

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

Post Reply