1.ora-38104: 无法更新 on 子句中引用的列
原因因为 在merge into 语句的update中 更新了用于作为on 链接的字段
merge into fxyd_rwsp sp using (SELECT ? RWPC_BH, SYSDATE SPSJ, ? XXLY_DM, ? SPYJ, ? SPYJSM, ? SPRY_DM, ? SPRY_MC, ? SPY_SWJG_DM FROM DUAL) newsp
注意
此处的
on (sp.rwpc_bh = newsp.RWPC_BH)
on (sp.rwpc_bh = newsp.RWPC_BH)
on (sp.rwpc_bh = newsp.RWPC_BH) when not matched then insert values(newsp.RWPC_BH,newsp.SPSJ,newsp.XXLY_DM,newsp.SPYJ,newsp.SPYJSM,newsp.SPRY_DM,newsp.SPRY_MC,newsp.SPY_SWJG_DM) when matched then
注意
sp.rwpc_bh = newsp.rwpc_bh
on的字段这里是不能更新的
on的字段这里是不能更新的
update set sp.rwpc_bh = newsp.rwpc_bh , sp.SPSJ = newsp.SPSJ, sp.XXLY_DM = newsp.XXLY_DM, sp.SPYJ = newsp.SPYJ, sp.SPYJSM = newsp.SPYJSM, sp.SPRY_DM = newsp.SPRY_DM, sp.SPRY_MC = newsp.SPRY_MC, sp.SPY_SWJG_DM = newsp.SPY_SWJG_DM2.ora-01789