Forward Declarations : Procedure Call « Stored Procedure Function « Oracle PL / SQL






Forward Declarations

   
SQL> DECLARE
  2    v_TempVal BINARY_INTEGER := 5;
  3
  4    PROCEDURE B(p_Counter IN OUT BINARY_INTEGER);
  5
  6    PROCEDURE A(p_Counter IN OUT BINARY_INTEGER) IS
  7    BEGIN
  8      IF p_Counter > 0 THEN
  9        B(p_Counter);
 10        p_Counter := p_Counter - 1;
 11      END IF;
 12    END A;
 13
 14    PROCEDURE B(p_Counter IN OUT BINARY_INTEGER) IS
 15    BEGIN
 16      p_Counter := p_Counter - 1;
 17      A(p_Counter);
 18    END B;
 19  BEGIN
 20    B(v_TempVal);
 21  END;
 22  /

PL/SQL procedure successfully completed.

SQL>
SQL>

   
    
  








Related examples in the same category

1.Call a stored procedure in a PL/SQL block
2.Call a stored procedure then other statements
3.Dependency Example
4.Exceptions in Subprograms
5.A PL/SQL procedure with no parameter
6.Exception throwed out of procedure call
7.Default parameter value
8.Pass parameter by data type
9.Calling ParameterLength illegally (ORA-6502)...
10.Use named notation
11.Use named notation, but with a different order of the formal parameters
12.This script demonstrates how to create and call a simple procedure.