i tried that too
system.db.runPrepUpdate(“INSERT INTO DEFLASKING_TRANSACTIONS(ROW_ID,TRXN_DATE,SHIFT,WORK_STATION_ID,PLANT_ID,SUB_LOCATION,CUSTOMER_NAME,OA_NUM,PARENT_MNO,CHILD_MNO,QUALITY,UNIT_WGT,TRACE_NO,BIN_NO,BIN_POSITION,STATION_NAME,STATUS,GB_STATUS,OPR_NAME,SUPR_NAME,COMPLETED_ON,CREATED_BY,CREATED_ON,ACTIVE,PF_ROW_ID)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) WHERE NOT EXISTS (SELECT * FROM DEFLASKING_TRANSACTIONS WHERE PLANT_ID = ? AND TRACE_NO = ?)”,[int(23),timestamp,unicode(shift),unicode(workstationid),unicode(plant_id),unicode(sub_location),unicode(‘null’),unicode(‘null’),unicode(‘null’),unicode(‘null’),unicode(‘null’),unicode(‘null’),unicode(traceno),unicode(binnum),unicode(‘null’),unicode(1),unicode(status),unicode(‘PENDING’),unicode(1),unicode(supervisor),timestamp,unicode(createdby),timestamp,unicode(active),int(89),unicode(plant_id),unicode(traceno)])
which shows error like
caused by org.python.core.PyException
Traceback (most recent call last):
File “function:runAction”, line 70, in runAction
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO DEFLASKING_TRANSACTIONS(ROW_ID,TRXN_DATE,SHIFT,WORK_STATION_ID,PLANT_ID,SUB_LOCATION,CUSTOMER_NAME,OA_NUM,PARENT_MNO,CHILD_MNO,QUALITY,UNIT_WGT,TRACE_NO,BIN_NO,BIN_POSITION,STATION_NAME,STATUS,GB_STATUS,OPR_NAME,SUPR_NAME,COMPLETED_ON,CREATED_BY,CREATED_ON,ACTIVE,PF_ROW_ID)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) WHERE NOT EXISTS (SELECT * FROM DEFLASKING_TRANSACTIONS WHERE PLANT_ID = ? AND TRACE_NO = ?), [23, Thu Jul 29 22:20:23 IST 2021, None, 45, 2001, Plant 2, null, null, null, null, null, null, 120579/6, 2396, null, 1, DEFLASKING COMPLETED, PENDING, 1, admin, Thu Jul 29 22:20:23 IST 2021, admin, Thu Jul 29 22:20:23 IST 2021, Yes, 89, 2001, 120579/6], NC01_2001_MES, , false, false)
caused by Exception: Error executing system.db.runPrepUpdate(INSERT INTO DEFLASKING_TRANSACTIONS(ROW_ID,TRXN_DATE,SHIFT,WORK_STATION_ID,PLANT_ID,SUB_LOCATION,CUSTOMER_NAME,OA_NUM,PARENT_MNO,CHILD_MNO,QUALITY,UNIT_WGT,TRACE_NO,BIN_NO,BIN_POSITION,STATION_NAME,STATUS,GB_STATUS,OPR_NAME,SUPR_NAME,COMPLETED_ON,CREATED_BY,CREATED_ON,ACTIVE,PF_ROW_ID)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) WHERE NOT EXISTS (SELECT * FROM DEFLASKING_TRANSACTIONS WHERE PLANT_ID = ? AND TRACE_NO = ?), [23, Thu Jul 29 22:20:23 IST 2021, None, 45, 2001, Plant 2, null, null, null, null, null, null, 120579/6, 2396, null, 1, DEFLASKING COMPLETED, PENDING, 1, admin, Thu Jul 29 22:20:23 IST 2021, admin, Thu Jul 29 22:20:23 IST 2021, Yes, 89, 2001, 120579/6], NC01_2001_MES, , false, false)
caused by PSQLException: ERROR: syntax error at or near "WHERE"
Position: 386