开始
DECLARE v_lower NUMBER :=1; v_upper NUMBER :=10; BEGIN FOR i IN v_lower .. v_upper LOOP dbms_output.put_line('i is: '|| i); END LOOP; END;
要注意,i 并没有进行事前定义。运行的结果是:
anonymous block completed i is: 1 i is: 2 i is: 3 i is: 4 i is: 5 i is: 6 i is: 7 i is: 8 i is: 9 i is: 10
结束
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/11/13/2768367.html,如需转载请自行联系原作者