used defined exception
SQL> SQL> declare 2 NESTED_EXCEPTION exception; 3 begin 4 5 raise NESTED_EXCEPTION; 6 7 exception 8 9 when NESTED_EXCEPTION then 10 dbms_output.put_line('NESTED_EXCEPTION caught!'); 11 end; 12 / NESTED_EXCEPTION caught! PL/SQL procedure successfully completed. SQL> SQL>