首页 > 代码库 > Oracle-Procedure LOOP

Oracle-Procedure LOOP

CREATE OR REPLACE PROCEDURE PROC AS
  i NUMBER;
  j NUMBER;


BEGIN
  i := 1;

  WHILE i <= 100 LOOP
    dbms_output.put_line(i);
    i := i + 1;
  END LOOP;


  FOR j in 1 .. 100 LOOP
    dbms_output.put_line(j);
  END LOOP;


EXCEPTION
  WHEN OTHERS THEN
    BEGIN
      ROLLBACK;
    END;
END PROC;

Oracle-Procedure LOOP