Print out an error message : Raise « PL SQL « Oracle PL / SQL






Print out an error message

    

SQL> declare
  2      str  varchar2(50);
  3  begin
  4      str := 'CAT';
  5  exception
  6      when others then
  7          raise_application_error (-20100, 'error#' || sqlcode || ' desc: ' || sqlerrm);
  8  end;
  9  /

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL>

   
    
    
    
  








Related examples in the same category

1.Raise your own exception
2.Raising an exception
3.Raising NO_DATA_FOUND Exception
4.RAISE_APPLICATION_ERROR
5.Raise different exception depends on value input
6.Raise exceptions for wrong parameters
7.Raises and manages a standard anonymous block PL/SQL program error.
8.This procedure demonstrates the use of RAISE_APPLICATION_ERROR.
9.Setting the message dynamically