SQLdb ApplyUpdates more than 1 record
Original Reporter info from Mantis: JoshyFun @joshyfun
-
Reporter name: José Mejuto
Original Reporter info from Mantis: JoshyFun @joshyfun
- Reporter name: José Mejuto
Description:
Using a SQLQuery and performing 2 or more inserts or deletes causes an exception when custom SQLDelete o SQLInsert strings are present.
Steps to reproduce:
As it needs a database problem I'll post a simple subfunction.
SQLQuery1.SQLDelete.Text:='DELETE from TABLE where ID=:ID';
SQLQuery1.SQL.Text:='SELECT * from TABLE';
SQLQuery1.Open;
SQLQuery1.Delete;
SQLQuery1.Next;
SQLQuery1.Delete;
SQLQuery1.ApplyUpdates;
Additional information:
The problem is that the if's seems to be wrong for Delete and Insert, but OK for update.
A proposed patch is attached and uses the same logic as Update.