循环
普通循环
while 循环
create or replace procedure myDemo5
as
n_count number := 0;
begin
while n_count < 5 loop
dbms_output.put_line(n_count);
n_count := n_count + 1;
end loop;
end;
# 调用
begin
myDemo5;
end;
for循环
create or replace procedure myDemo06
as
begin
FOR USE in (select * from T_USER_INFO) loop
if (USE.id<3) then
dbms_output.put_line(USE.USER_NAME);
end if;
end loop;
end;
# 调用
CALL myDemo06();