Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

halting an oracle trigger

707939Dec 7 2009 — edited Dec 12 2009
greetings.

does anyone know of a way that i can exit a trigger with one statement.
i have code in the following structure:
------------------------------------------------------------------------------------------------
begin
IF <condition true> THEN
{NEED TO EXIT THE TRIGGER HERE}
END IF;

RAISE_APPLICATION_ERROR(-20000, 'Record Locked - Cannot Be Updated');
END;
------------------------------------------------------------------------------------------------

i realize that the obvious solution is to put the RAISE_APPLICATION_ERROR into the else clause and be done with it, but the front-end application that I'm developing against doesn't properly handle application errors thrown from inside IF blocks (don't ask me why, its a third party item i have no control over, but have a growing annoyance for).
i know that a statement to exit a trigger should never be needed, but i'm hoping it exists before looking for alternate solutions.

thanks in advance.
matt

Edited by: user6388889 on Dec 7, 2009 1:43 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2010
Added on Dec 7 2009
27 comments
3,526 views