Oracle-A表a字段更新后,修改b字段的值,写了个触发器,执行报错ora-04091
触发器如下:CREATEORREPLACETRIGGERtrigger_XQCSAFTERupdateonhi_psndoc_ctrtforeachrowbeginupd...
触发器如下:
CREATE OR REPLACE TRIGGER trigger_XQCS
AFTER update on hi_psndoc_ctrt
for each row
begin
update hi_psndoc_ctrt
set glbdef1 = (select count(conttype)
from hi_psndoc_ctrt
where conttype = 2);
end;
update hi_psndoc_ctrt set conttype = '2' where PK_PSNDOC_SUB = '1002T810000000000RIK';
报错
ORA-04091: 表 USER0923.HI_PSNDOC_CTRT 发生了变化, 触发器/函数不能读它
ORA-06512: 在 "USER0923.TRIGGER_XQCS", line 2
ORA-04088: 触发器 'USER0923.TRIGGER_XQCS' 执行过程中出错 展开
CREATE OR REPLACE TRIGGER trigger_XQCS
AFTER update on hi_psndoc_ctrt
for each row
begin
update hi_psndoc_ctrt
set glbdef1 = (select count(conttype)
from hi_psndoc_ctrt
where conttype = 2);
end;
update hi_psndoc_ctrt set conttype = '2' where PK_PSNDOC_SUB = '1002T810000000000RIK';
报错
ORA-04091: 表 USER0923.HI_PSNDOC_CTRT 发生了变化, 触发器/函数不能读它
ORA-06512: 在 "USER0923.TRIGGER_XQCS", line 2
ORA-04088: 触发器 'USER0923.TRIGGER_XQCS' 执行过程中出错 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询