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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -