Oracle函数返回表类型(二)

2014-11-24 16:04:13 · 作者: · 浏览: 1
lare
cur_out_arg mypk.t_cursor;
rec_arg test%rowtype;
begin
mypk.proc('abc',cur_out_arg,3);
--open cur_out_arg;
loop
--提取一行数据到rec_arg
fetch cur_out_arg into rec_arg;
--判读是否提取到值,没取到值就退出
--取到值cur_out_arg%notfound 是false
--取不到值cur_out_arg%notfound 是true
exit when cur_out_arg%notfound;
dbms_output.put_line(rec_arg.id||'-'||rec_arg.name);
end loop;
--关闭游标
close cur_out_arg;
end;