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.
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.