oracle11g - Oracle trigger before and after insert -
is possible create 1 trigger in oracle fires before , after data got inserted table?
begin if inserting -- code should run before insertion: :new.cr_timestamp := systimestamp; if :new.id null select sq_table_id.nextval :new.id dual; end if; -- want code run after insertion.. end if; end;
so there flag indicates if before or after insertion?
it can written below.
create or replace trigger compound_trigger_name [insert|delete|update [of column] on table compound trigger --executed before dml statement before statement begin null; end before statement; --executed aftereach row change- :new, :old available after each row begin null; end after each row; --executed after dml statement after statement begin null; end after statement; end compound_trigger_name;
Comments
Post a Comment