Raise exception from inner function : Function Definition « Stored Procedure Function « Oracle PL / SQL






Raise exception from inner function

    

SQL> DECLARE
  2    myException EXCEPTION;
  3    FUNCTION innerFunction
  4    RETURN BOOLEAN IS
  5      retval BOOLEAN := FALSE;
  6    BEGIN
  7      RAISE myException;
  8      RETURN retval;
  9    END;
 10  BEGIN
 11    IF innerFunction THEN
 12      dbms_output.put_line('No raised exception');
 13    END IF;
 14  EXCEPTION
 15    WHEN others THEN
 16      dbms_output.put_line('DBMS_UTILITY.FORMAT_ERROR_BACKTRACE');
 17      dbms_output.put_line(dbms_utility.format_error_backtrace);
 18
 19  END;
 20  /

PL/SQL procedure successfully completed.

   
    
    
    
  








Related examples in the same category

1.Define and call a function
2.Define and use function in select clause
3.A stored function.
4.Use user-defined function in if statement
5.Recursive function
6.function with no return type
7.Recursive function Factorial
8.A local function
9.Recursive function 2
10.demonstrates the behavior of the DETERMINISTIC keyword.
11.Function to convert celsius to fahrenheit
12.Function to convert fahrenheit to celsius
13.A function is executed like any other SQL built-in function:
14.Count Employee from a function and return value back
15.How stored functions can be called from SQL