I have a table with some denormalized precalculated columns that are maintained by a trigger. The data sometimes is corrupted and the process fails but in these cases I need just ignore the exceptions and continue because it is not important to catch the error.
How can I write the exception clause to just go on without raising any error when an exception ocurrs?
I've tried just leaving the clause empty:
...
EXCEPTION
WHEN OTHERS THEN
end test_trigger;
but it does not compile.
What am I missing? there is some "pass" clause that I should be including?
If Trigger B throws an exception, the current connection is rolled back to the point before the statement in Trigger A that caused Trigger B to fire. Trigger A is then free to catch the exception thrown by Trigger B and continue with its work.
Your insert will either entirely succeed (insert into t1 and into t2 succeed) or neither will - both will "fail" because the statement itself failed. So, after your insert, if the trigger failed - the database will look like your insert never ever happened.
Yes. very easy solution is to use ON-ERROR trigger at any level of forms.
A trigger exception (also known as a "blocking trigger") is a kind of trigger that can be used to block another trigger's ability to fire under certain conditions. For example, if a tag has a trigger to fire on all pages and a trigger exception that is set to "Page URL equals thankyou.
...
EXCEPTION
WHEN OTHERS THEN
NULL;
end test_trigger;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With