xxxxxxxxxx
-- Raise an APPLICATION_ERROR to exit a procedure
DECLARE
e_exit EXCEPTION;
PRAGMA EXCEPTION_INIT(e_exit , -20999);
BEGIN
DBMS_OUTPUT.PUT_LINE('starting');
IF 1=1 THEN
DBMS_OUTPUT.PUT_LINE('after...');
RAISE_APPLICATION_ERROR(-20999, null);
END IF;
DBMS_OUTPUT.PUT_LINE('ending');
EXCEPTION WHEN e_exit THEN null;
END;
/