永发信息网

oracle触发器可否实现警告,之后继续执行

答案:3  悬赏:20  手机版
解决时间 2021-03-10 00:18
oracle触发器可否实现警告,之后继续执行
最佳答案
可以
你需要再定义一个触发器B,当触发器A被触发时 触发 触发器B
然后具体什么警告你可以写在触发的逻辑代码中
全部回答
不知道你的警告是什么意思,但是你可以做一张表,名叫警告表, 触发器想发出警告的时候,把警告信息添加到警告表。然后继续。 事后,我们查询警告表。看看都有些什么警告发生。

一个触发器试图修改或查询目前正在触发器语句修改的表。建议改一下你的触发器逻辑。

网上也有解释:

error:   ora-04091: table name is mutating, trigger/function may not see it

cause:   a statement executed a trigger or custom pl/sql function. that trigger/function tried to modify or query a table that is currently being modified by the statement that fired the trigger/function.

action:   the options to resolve this oracle error are:     rigger/function so that it does not try to modify/query the table in question.     for example, if you've created a trigger against the table called orders and then the trigger performed a select against the orders table as follows:

    create or replace trigger orders_after_insert     after insert     on orders     for each row

    declare     v_quantity number;

    begin

    select quantity     into v_quantity     from orders     where order_id = 1;

    end;

you would receive an error message as follows:

when you create a trigger against a table, you can't modify/query that table until the trigger/function has completed.

remember that you can always use the :new and :old values within the trigger, depending on the type of trigger.

我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
上海浦东新区临港物流园区捷畅路156号在哪个
瑞丽房地产高青NO.1地址有知道的么?有点事想
【kui】kui第二声的字共有哪些?
大家知道常见的杂志大小吗?
07奥德赛 副驾驶位置座椅加热怎么关
【有什么字带娄列:楼 把娄加一个偏旁加组词
【高分悬赏!】高中班级手抄报的题目及内容,
出境可以托运几个行李箱啊?
刘家厂在哪里啊,我有事要去这个地方
索尼fe70-200有没有遮光罩
【洁白无暇的意思】洁白无瑕的意思是什么?
金立6s运行内存比苹果6还大吗
潮小鲜我想知道这个在什么地方
请问,游戏种突然提示与服务器断开连接,怎么
68号齿轮油可用什么型号的润滑油代替
推荐资讯
沁阳市焦作沁阳市交通运输局我想知道这个在什
内蒙宁城县天义镇当地风俗女方是内蒙天义镇聘
舍迷的心是什么意思
宁波至成为都高铁
【show you】英语.show 介词 you有这种形式吗
纸制相片被圆珠笔画到怎么办?
QQ水浒怎么送好友东西
“让我拥抱你真新的面孔 ”是哪首歌的其中的
饥荒海难制冰机3000怎么用 制冰机3000用法
迪优美特激活失败怎么解决
请教:经常对着电脑工作,感觉眼睛快瞎了,求
69800是国家投放的吗
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?