Loop with a Label : Label « PL SQL « Oracle PL / SQL






Loop with a Label

   

SQL> BEGIN
  2     <<l_For_Loop>>
  3     FOR v_count IN 1 .. 20
  4     LOOP
  5        DBMS_OUTPUT.PUT_LINE('Iteration: '||v_count);
  6     END LOOP l_For_Loop;
  7  END;
  8  /
Iteration: 1
Iteration: 2
Iteration: 3
Iteration: 4
Iteration: 5
Iteration: 6
Iteration: 7
Iteration: 8
Iteration: 9
Iteration: 10
Iteration: 11
Iteration: 12
Iteration: 13
Iteration: 14
Iteration: 15
Iteration: 16
Iteration: 17
Iteration: 18
Iteration: 19
Iteration: 20

PL/SQL procedure successfully completed.

SQL>

   
    
    
  








Related examples in the same category

1.A labeled block.
2.Using labels with loops
3.Changing labeled loop execution with EXIT statements
4.Use label to mark outer loop and inner loop
5.Block with label