Question : Oracle After Insert Trigger

If the trigger is an "after insert" and within the trigger calls a procedure which raises an application error, will the row still be inserted?

I want the insert to take place even if the procedure the after insert trigger calls fails. Is this possible? How is this done?

Answer : Oracle After Insert Trigger

By default, the insert will be rolled back if the "after insert" trigger encounters an error.  But, you can write the "after insert" trigger to handle the exception locally and not cause the triggering insert to be rolled back.  Your trigger just needs to look something like this:

create or replace trigger [your_trigger_name]
after insert on [your_table_name]
for each row
begin
  [your_procedure_name (parameters, etc.)];
exception
  when others then
     [null; or whatever you want to happen if an error is encountered];
end;
/
Random Solutions  
 
programming4us programming4us