I have a Power Table in my window. I am populating it using scripting and some variables. What I want to do next is have the ability to select a row in the table click a button and delete the row from the SQL database. I keep getting an error when I try this.
number = system.tag.read("[Client]Delete_Number").value
system.tag.write("[Client]Delete_Number",number)
query = 'DELETE FROM SF_Paint_Schedule WHERE UID = ?'
args = (number)
system.db.runPrepUpdate(query,args) ```
This is the error I get. I notice it is doing some crazy stuff withe the variable. it should be 12.
Traceback (most recent call last):
File "<event:actionPerformed>", line 8, in <module>
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(DELETE FROM SF_Paint_Schedule WHERE UID = "?", [0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], , , false, false)
caused by Exception: Error executing system.db.runPrepUpdate(DELETE FROM SF_Paint_Schedule WHERE UID = "?", [0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], , , false, false)
caused by GatewayException: SQL error for "DELETE FROM SF_Paint_Schedule WHERE UID = "?"": The index 1 is out of range.
caused by SQLServerException: The index 1 is out of range.
Ignition v7.9.9 (b2018081621)
Java: Oracle Corporation 1.8.0_181
Thanks in advance for the help.