Code is executed from an system.util.invokeAsynchronous() (gateway scope).
Code
current_data = system.tag.readBlocking([
"[UNS]Machine01/Room01/Tag1",
"[UNS]Machine01/Room01/Tag2"
])
query = """
SELECT op.operationid FROM operations op
INNER JOIN operations_steps st
ON op.operationid = st.operationid
WHERE op.workorderid = ?
AND JSON_VALUE(op.context, '$.iteration') = ?
AND st.step = 7;
"""
step_exist = system.db.runPrepQuery(
query,
[
current_data[0].value,
current_data[1].value
],
"DB"
)
I tested the query in the database and worked without problem. For some reason whenever I use the runPrepQuery it doesn't work.
The error says "Command not properly ended"???
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayResponse$GatewayThrowable: ORA-00933: SQL command not properly ended
I know I'm missing something because I used these type of queries before...
Thanks in advance!