Good morning Team,
I am running an update query on a table and i am getting an error. I see where the error is happening but not sure on how to correct.
Query to populate the tabel:
SELECT id, case_type, chute, chute_area, target, ordered, state
FROM chutes
Query to update the tabel:
UPDATE `Clemens`.`chutes` SET `case_type` = :case_Type , `target` = :targetQTY , `state` = :stateAvail WHERE (`id` = :iD );
Configure on Action Performed
def runAction(self, event):
import time
case_type = self.getSibling("Table").props.selection.data[0].case_type
target = self.getSibling("Table").props.selection.data[0].target
state = self.getSibling("Table").props.selection.data[0].state
id = self.getSibling("Table").props.selection.data[0].id
category = "HMI"
source = "ASCADA Client"
usr = self.session.props.auth.user.id
message = str(usr) + " Inserted " + str(case_type), str(target) + " in WCS "
data9 = usr
# Insert new SKU
system.db.runNamedQuery("Tables/Chutes_Updates",{
"caseType": case_type,
"targetQTY": target,
"stateAvail": state,
"iD": id
})
time.sleep(2)
# Refresh table data
self.getSibling("Table").refreshBinding()
#Update Syslog
system.db.runNamedQuery("Tables/syslog_update",{
"category": category,
"source": source,
"message": message,
"data9": data9
})
time.sleep(2)
self.getSibling("Table").props.selection.data[0].case_type= " "
self.getSibling("Table").props.selection.data[0].target= " "
self.getSibling("Table").props.selection.data[0].state= " "
self.getSibling("Table").props.selection.data[0].id= " "