create or replace procedure zxs as
cursor c1 is select * from userlist; --定义游标,将表中一行定义为一个游标变量
type v_row is table of userlist%rowtype; --生成自定类型行
user_list_row v_row; --定义行类型
begin
open c1;
loop
fetch c1 bulk collect into user_list_row;
for i in 1..user_list_row.count
loop
dbms_output.put_line(user_list_row(i).userid||' '||user_list_row(i).username);
end loop;
exit when user_list_row.count < 1000;
end loop;
close c1;
end;
fetch bulk collect limt 学习
最新推荐文章于 2022-04-02 14:34:28 发布