SQL>
SQL> set serveroutput on
SQL> set echo on
SQL>
SQL> BEGIN
2 <<outerloop>>
3 FOR v_outerloopcounter IN 1..2 LOOP
4 <<innerloop>>
5 FOR v_innerloopcounter IN 1..4 LOOP
6 DBMS_OUTPUT.PUT_LINE('Outer Loop counter is '||
7 v_outerloopcounter ||
8 ' Inner Loop counter is ' ||
9 v_innerloopcounter);
10 EXIT outerloop WHEN v_innerloopcounter = 3;
11 END LOOP innerloop;
12 END LOOP outerloop;
13 END;
14 /
Outer Loop counter is 1 Inner Loop counter is 1
Outer Loop counter is 1 Inner Loop counter is 2
Outer Loop counter is 1 Inner Loop counter is 3
PL/SQL procedure successfully completed.
SQL>
|