首页 > 代码库 > orable常用语句

orable常用语句

1.for循环语句:

for loop_counter in [REVERSE] lowest_number .. highest_number
loop
  {.statements.}
end loop;

 示例:

declare
  v_i number(4) := 0;
begin
  for v_i in 0 .. 10
  loop
    dbms_output.put_line(v_i);
  end loop;
end;

 

begin
  for rec in (select * from dba_objects where rownum<100) loop
    dbms_output.put_line(rec.object_id);
  end loop;
end;

 

2.while循环语句: