CREATE OR REPLACE TRIGGER UPDATE_TEST_280510
AFTER insert on TEST_TRNCOMPVISIT
declare
V_TRNCOMPNO NUMBER(10);
CURSOR C1 IS SELECT B.COMPNO FROM TEST_TRNCOMPVISIT A, TEST_TRNCOMPMST B,
TEST_MEMMAST C
WHERE A.COMPNO=B.COMPNO
AND B.TRNMEMID=C.MEMID
AND C.MEMOS>=1000;
begin
open c1;
fetch c1 into V_TRNCOMPNO;
UPDATE TEST_TRNCOMPMST SET COMPSTATUS='P',
remark='comp is pending due to O/S>1000'
WHERE COMPNO=V_TRNCOMPNO AND COMPSTATUS='C';
CLOSE C1;
end;
我已经制作了这个触发器,并在表中插入行时 - TEST_TRNCOMPVISIT 它给出了以下错误 -
发生以下错误:
ORA-04091:表 TEST.TEST_TRNCOMPVISIT 正在变异,触发器/函数可能看不到它
ORA-06512:在“TEST.UPDATE_TEST_280510”,第 4 行
ORA-06512:在“TEST.UPDATE_TEST_280510”,第 10 行
ORA-04088:在执行触发器'TEST.UPDATE_TEST_280510'