trigger on view 不能触发

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-21 11:28   24   0
Today create a trigger on a view like:
create or replace
TRIGGER trigger_name
INSTEAD OF UPDATE ON view_name
FOR EACH ROW
DECLARE

BEGIN

send date to other tables.

EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
ROLLBACK;

END;

after create trigger,i create a sql to test it,
UPDATE view_name SET column_a='a';
problem comes,the trigger cann't fired,just see result 0 record updated.
cost many time,later find the key problem is there is no date in view some no record be updated,so the trigger will not be fired.the best way to void this problem is to use insert sql statement instead of update sql statement.
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP