SQL>
SQL> set serveroutput on
SQL>
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 DBMS_OUTPUT.PUT_LINE('A(' || p_Counter || ')');
9 IF p_Counter > 0 THEN
10 B(p_Counter);
11 p_Counter := p_Counter - 1;
12 END IF;
13 END A;
14
15 PROCEDURE B(p_Counter IN OUT BINARY_INTEGER) IS
16 BEGIN
17 DBMS_OUTPUT.PUT_LINE('B(' || p_Counter || ')');
18 p_Counter := p_Counter - 1;
19 A(p_Counter);
20 END B;
21 BEGIN
22 B(v_TempVal);
23 END;
24 /
B(5)
A(4)
B(4)
A(3)
B(3)
A(2)
B(2)
A(1)
B(1)
A(0)
PL/SQL procedure successfully completed.
SQL>
SQL>
|