|
SQL>
SQL> – Using labels with loops.
SQL> BEGIN
2 <<outerloop>>
3 FOR i IN 1..2 LOOP
4 <<innerloop>>
5 FOR j IN 1..4 LOOP
6 DBMS_OUTPUT.PUT_LINE(‘Outer Loop counter is ‘ || i ||
7 ‘ Inner Loop counter is ‘ || j);
8 END LOOP innerloop;
9 END LOOP outerloop;
10 END;
11 /
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
Outer Loop counter is 1 Inner Loop counter is 4
Outer Loop counter is 2 Inner Loop counter is 1
Outer Loop counter is 2 Inner Loop counter is 2
Outer Loop counter is 2 Inner Loop counter is 3
Outer Loop counter is 2 Inner Loop counter is 4
PL/SQL procedure successfully completed.
SQL>
SQL>
|
Tags: Code, Label, Label laquo PL SQL laquo Oracle PL SQL, Oracle PL / SQL, PL SQL, Using labels with loops
Posted in Uncategorized |
This entry was posted
on Tuesday, June 30th, 2009 at 6:37 pm and is filed under Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.