Mega Code Archive

 
Categories / Oracle PLSQL / PL SQL
 

Loop index scope is limited to the FOR loop

SQL> BEGIN   2    FOR i IN 1..10 LOOP   3      dbms_output.put_line('The index value is ['||i||']');   4    END LOOP;   5  END;   6  / The index value is [1] The index value is [2] The index value is [3] The index value is [4] The index value is [5] The index value is [6] The index value is [7] The index value is [8] The index value is [9] The index value is [10] PL/SQL procedure successfully completed. SQL> SQL>