Greetings. I am trying to give a handful of our assembly managers the ability to modify Equipment check sheets that our assembly workers are filling out on a continual basis. The plan is they can view history, Create, or modify the Equipment Check Sheets that are just values stored in SQL. I have the create working fine, but in my SQL table I assign a process_id to each check just for reference purposes. I'm trying to offer them the ability to modify check sheets, case in point if a numeric value of a torque reading needs to be changed for them to keep track of etc.
I have a table that has the existing Equipment checks in it, with a subview that's just a flex container with some text areas correlating to the fields in SQL so they manager can type in whatever they want to change and there's a button on the bottom of that flex container that when pressed passes this:
def runAction(self, event):
"""
Method that will run whenever the selected event fires.
Arguments:
self: A reference to the component that is invoking this function.
event: Events fired by the relevant mouse/touch interaction.
altKey (bool): True if the 'alt' key was held down when the event
was fired.
button (int | float): The button number that was pressed when the
event was fired.
buttons (int | float): The buttons being depressed when the event
was fired.
clientX (int | float): The X coordinate in local coordinates.
clientY (int | float): The Y coordinate in local coordinates.
ctrlKey (bool): True if the 'ctrl' key was held down when the event
was fired.
metaKey (bool): True if the 'meta' key was held down when the event
was fired.
pageX (int | float): The X coordinate relative to the whole
document.
pageY (int | float): The Y coordinate relative to the whole
document.
screenX (int | float): The X coordinate in global (screen)
coordinates.
screenY (int | float): The Y coordinate in global (screen)
coordinates.
shiftKey (bool): True if the 'shift' key was held down when the
event was fired.
"""
c=self.getSibling("TextField").props.text
s=self.getSibling("TextField_0").props.text
cm=self.getSibling("TextField_1").props.text
f=self.getSibling("TextField_2").props.text
l=self.getSibling("TextField_3").props.text
sh=self.getSibling("TextField_4").props.text
id=self.view.params.value.Process_ID
system.db.runPrepUpdate("Update FMA_Process_Master SET CheckItems=?, StandardNumericalValue=?,CheckMethod=?,Frequency=?,Line=?,ShiftRequired=? WHERE Process_id=?",[c,s,cm,f,l,sh,id])
I know the process_id is passed through I just added a label on the flex container just to verify, but for some reason I get this error message on press:
com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
File "function:runAction", line 9, in runAction
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(Update FMA_Process_Master SET CheckItems=?, StandardNumericalValue=?,CheckMethod=?,Frequency=?,Line=?,ShiftRequired=? WHERE Process_id=?, [stuff, stuf, stuff, stuff, stuff, 1, 1], genericSQL, , false, false)
caused by org.python.core.PyException
Traceback (most recent call last):
File "function:runAction", line 9, in runAction
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(Update FMA_Process_Master SET CheckItems=?, StandardNumericalValue=?,CheckMethod=?,Frequency=?,Line=?,ShiftRequired=? WHERE Process_id=?, [stuff, stuf, stuff, stuff, stuff, 1, 1], genericSQL, , false, false)
caused by Exception: Error executing system.db.runPrepUpdate(Update FMA_Process_Master SET CheckItems=?, StandardNumericalValue=?,CheckMethod=?,Frequency=?,Line=?,ShiftRequired=? WHERE Process_id=?, [stuff, stuf, stuff, stuff, stuff, 1, 1], genericSQL, , false, false)
caused by SQLServerException: The conversion from UNKNOWN to UNKNOWN is unsupported.
Has anyone every seen that conversion error message and by chance know how to fix it? Thanks in advance!