我有这样的查询:
UPDATE
(SELECT STATUS, T_ID FROM FINANCE.RKAP_RENCANA a
LEFT JOIN FINANCE.RKAP_MASTER_KODE b ON b.ID_KODE = a.KODE_ANGGARAN
WHERE a.TAHUN = '2018' AND b.KET_KD_GAS = 'BSI') t1
SET t1.STATUS = '1', t1.T_ID = '5d81a2b1d36a1'
我希望将更新状态和ID_Kode设置为1和5d81a2b1d36a1,但是始终显示此错误代码
ORA-01779:无法修改映射到非键保留表的列
我一直在与:
update finance.rkap_rencana set status = '1', t_id = '5d81a2b1d36a1'
但是,这不是我想要的。
有人知道该怎么做吗?
谢谢
答案 0 :(得分:1)
如果我了解严格性:
UPDATE FINANCE.RKAP_RENCANA a SET a.STATUS = '1', a.T_ID = '5d81a2b1d36a1'
WHERE a.TAHUN = '2018'
AND EXISTS (SELECT 1 FROM FINANCE.RKAP_MASTER_KODE b
WHERE b.ID_KODE = a.KODE_ANGGARAN
AND b.KET_KD_GAS = 'BSI')