Good Morning,
I am trying to do a SQL Insert through Scripting. I have it set on the Action performed of a button. Unfortunately I can’t seem to get it to work.
Here is the script I have in place:
PO = "CT/Variables/PO Number"
Model = "CT/Variables/Model Number"
PL = "[Client]Production Line"
St = "[Client]Station"
Min = "5"
DT = "123456"
Query = "INSERT INTO Ign_CT_PauseRecords (PONumber, ModelNumber, ProductionLine, Station, Minutes, DateTime) VALUES (?, ?, ?, ?, ?, ?)"
args = [PO, Model, PL, St, Min, DT]
system.db.runPrepUpdate(Query, args)
Each Time I run the application i just get a huge list of error details I can’t understand.
07:31:39.330 [AWT-EventQueue-2] ERROR com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter - <HTML>Error executing script for event: <code><b>actionPerformed</b></code><BR>on component: <code><b>Button</b></code>.
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last):
File "<event:actionPerformed>", line 16, in <module>
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO Ign_CT_PauseRecords (PONumber, ModelNumber, ProductionLine, Station, Minutes, DateTime) VALUES (?, ?, ?, ?, ?, ?), [CT/Variables/PO Number, CT/Variables/Model Number, [Client]Production Line, [Client]Station, 5, 123456], , , false, false)
Any assistance would be greatly appreciated, and thank you in advance.