执行触发器时出错

执行触发器时出错

本文介绍了变异,触发器/函数可能看不到它-执行触发器时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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时出现以下错误-

I have made this trigger and while insert the row in table- TEST_TRNCOMPVISIT it gives following error-

发生以下错误:

推荐答案

这是您唯一的触发器吗?您的触发器更新表TEST_TRNCOMPMST.如果此表上有一个访问TEST_TRNCOMPVISIT的触发器,则会显示错误消息.

Is this the only trigger you have?Your trigger updates table TEST_TRNCOMPMST. If there is a trigger on this table that accesses TEST_TRNCOMPVISIT you get the error message.

这篇关于变异,触发器/函数可能看不到它-执行触发器时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 05:49