Raising NO_DATA_FOUND : Raise Exception « PL SQL Programming « Oracle PL/SQL Tutorial






SQL>
SQL> DECLARE
  2    TYPE t_NumberTableType IS TABLE OF NUMBER
  3      INDEX BY BINARY_INTEGER;
  4    v_NumberTable t_NumberTableType;
  5    v_TempVar NUMBER;
  6  BEGIN
  7    v_TempVar := v_NumberTable(1);
  8  END;
  9  /
DECLARE
*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at line 7


SQL>
SQL>








24.16.Raise Exception
24.16.1.User-Defined Errors
24.16.2.Raise Exception in a function
24.16.3.Raising an Exception Local PL/SQL Block
24.16.4.Avoiding exceptions raised in declaration part and exception handler
24.16.5.Raising an Exception in the Declaration Section
24.16.6.Exceptions Raised in the Exception Handler
24.16.7.Raising NO_DATA_FOUND
24.16.8.Raising a custom exception
24.16.9.Using WHEN OTHERS clause
24.16.10.Using SQLCODE and SQLERRM
24.16.11.Propogating a Server-side Customized Error Number and Error Message to client program using PRAGMA EXCEPTION_INIT