I am trying to update a row in a database table using two SQL statements. My script:
param1 = {"IG_Tag":"SCADA_ALARM_CP01_0_2"}
param2 = {"IG_Index":Idx}
system.db.runNamedQuery("Get_Alarm", param1)
system.db.runNamedQuery("Update_Display", param1, param2)
The first Query works fine (sets a bunch of column values in the ‘igeventdisp’ table)
The second Query is:
UPDATE igeventdisp
SET IG_Event_Set_Time = current_timestamp(0), IG_Event_Index = :IG_Index
WHERE IG_PLC_Tag = :IG_Tag;
The error is “Transaction “{’,IG_Index’: 103.0}” is closed.”
I have tried wrapping the first query with:
system.db.beginTransaction("")
system.db.closeTransaction("") {with and without system.db.commitTransaction("")}
Each query runs fine when executed by themselves.
Do any DB people have a clue, (as I am clueless)?