while循环

declare
  v_i number:=1;
begin
  while(v_i<=3)loop
      dbms_output.put_line('v_i='||v_i);
      v_i:=v_i+1;
  end loop;
end;

for循环

declare
  v_i number:=1;
begin
  for v_i in 1..3loop
    dbms_output.put_line('v_i'||v_i);
    end loop;
end;

for循环判断

declare
    v_i number:=1;
begin
  for v_i in 1..10 loop
      if v_i=5 then
        exit;
      end if;
      dbms_output.put_line('v_i'||v_i);
end loop;
end;

continue

declare
    v_i number:=1;
begin
  for v_i in 1..10 loop
      if v_i=5 then
        continue;
      end if;
      dbms_output.put_line('v_i'||v_i);
end loop;
end;