Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Triggers
On the hr.employees table, i have a 3 triggers - before update , before
update for each row , after update for each row ..
They only have dbms_output as part of the code.
SQL> create or replace trigger trg_employees_bu
2 before update on employees
3 begin
4 dbms_output.put_line('Firing Before update .....');
5 end;
6 /
Trigger created.
SQL> select trigger_name from user_triggers;
TRIGGER_NAME
TRG_EMPLOYEES_AUFER TRG_EMPLOYEES_BU TRG_EMPLOYEES_BUFER
SQL> update employees set salary=salary where employee_id=195;
Firing Before update .....
Firing Trigger Before Update for each row.....
Firing trigger after update for each row .....
1 row updated.
SQL> roll;
Rollback complete.
I understand the sequence here. First fires the trigger stmt level and row level triggers.
SQL> update employees set salary=salary*.1 where employee_id=195;
update employees set salary=salary*.1 where employee_id=195
*
ERROR at line 1:
ORA-02290: check constraint (TEST_PLSQL.CK_SALARY) violated
SQL> update employees set salary=salary where employee_id=195;
Firing Before update .....
Firing Trigger Before Update for each row.....
Firing trigger after update for each row .....
Firing Before update .....
Firing Trigger Before Update for each row.....
Firing trigger after update for each row .....
1 row updated.
When an update fails, then why i am seeing the trigger firing twice even though it updated only one row. Received on Wed Jan 19 2005 - 19:26:48 CST