If a triggering statement omits a column list, the trigger is fired when any column of the associated table is updated.
A column list cannot be specified for statement trigger is fired again.
The thr To see this capability in action, first create the sales_history table to hold the old rows from the sales table. The example below replaces the standard notation with early and late create or replace trigger sales_history2_tr 2 before update or delete on sales 3 referencing old as early new as late 4 for each row 5 begin 6 insert into sales_history 7 ( CHG_DATE, 8 CHG_TYPE, 9 STORE_KEY, 10 BOOK_KEY, 11 ORDER_NUMBER, 12 ORDER_DATE, 13 QUANTITY) 14 values 15 ( sysdate, 16 'UPDATE', 17 :early.
This table will have the same columns as the sales table plus a column for the change date and a column for the change method.
if inserting then INSERT INTO SRC_TBL (CFG_NAME, CFG_VALUE) VALUES(: NEW. CFG_VALUE); elsif updating then UPDATE SRC_TBL SET CFG_VALUE = : NEW.
Under certain conditions a record inserted by application needs to be deleted.
I created an After Insert trigger, but I get the following error ORA-04091 ' table KBM_MESSAGES is mutating, trigger/function may not see it' How should I format such a trigger that I can delete the row being inserted (firing the trigger) Note: I do not want to rollback the transaction, it should not interfere with any other processing performed by application.
Oracle Database automatically executes a trigger when a specified event takes place, which may be in the form of a system event or a DML statement being issued against the table.
Triggers can be: Trigger names must be unique with respect to other triggers in the same schema.