- for循环demo1 数字循环
BEGIN
FOR I IN 1 .. 100 LOOP
-- 输出I的值
SYS.DBMS_OUTPUT.PUT_LINE(I);
END LOOP;
END;
- for循环demo2 表记录循环
BEGIN
FOR CURR_ROW IN (SELECT COL1,COL2 FROM TEST_TABEL)
-- 遍历输出字段COL1的值
SYS.DBMS_OUTPUT.PUT_LINE(CURR_ROW.COL1);
END LOOP;
END;