Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / PL SQL Statements
 

The upper or lower bounds of the FOR loop can be defined as variables or functions

SQL> SQL> declare   2      V_lower NUMBER:=2/3;   3  begin   4      for main_c in reverse v_lower..10/3   5      loop   6          DBMS_OUTPUT.put_line(main_c);   7      end loop;   8  end;   9  / 3 2 1 PL/SQL procedure successfully completed. SQL>