ITeye博客

trigger on view 不能触发

ydcworld · 2014-08-14 19:12 · dataBase · 编程语言 · Markdown

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)

暂无评论。

评论功能维护中,当前仅展示历史评论。