我尝试创建Oracle代码,以STATUS = 'Resolved'
的左侧联合更新TBL_RPT_CONS_2.ERR_MSG1 = TBL_OPENJOB.ERR_MSG
,其中ERR_MSG1
上的TBL_RPT_Cons_2
为空。
Update TBL_RPT_CONS_2 Status
Set STATUS = 'Resolved'
FROM TBL_RPT_CONS_2 TBL_RPT_CONS_2
LEFT OUTER JOIN TBL_OPENJOB TBL_OPENJOB
ON (TBL_RPT_CONS_2.ERR_MSG1 = TBL_OPENJOB.ERR_MSG)
WHERE (TBL_OPENJOB.ERR_MSG IS NULL)
AND (TBL_RPT_CONS_2.DOLV_REPORT_NAME = 'ICS1500-4')
AND (TBL_RPT_CONS_2.STATUS = 'Open')
我可以使用select查看但无法更新。
SELECT TBL_RPT_CONS_2.STATUS
FROM HRD_DEV.TBL_RPT_CONS_2 TBL_RPT_CONS_2
LEFT OUTER JOIN HRD_DEV.TBL_OPENJOB TBL_OPENJOB
ON (TBL_RPT_CONS_2.ERR_MSG1 = TBL_OPENJOB.ERR_MSG)
WHERE (TBL_OPENJOB.ERR_MSG IS NULL)
AND (TBL_RPT_CONS_2.DOLV_REPORT_NAME = 'ICS1500-4')
AND (TBL_RPT_CONS_2.STATUS = 'Open')