举例:--创建procedure create or replace procedure sql_test(out_return out sys_refcursor) is begin open out_return for 'select * from tgp_funds'; end;--引用declare cur1 SYS_REFCURSOR; i tgp_funds%rowtype; begin sql_test(cur1); loop fetch cur1 into i; exit when cur1%notfound; dbms_output.put_line('----------------:' || i.fnd_id);--fnd_id为表tgp_funds中的fnd_id 列 end loop; close cur1; end;
举例:--创建procedure create or replace procedure sql_test(out_return out sys_refcursor) is begin open out_return for 'select * from tgp_funds'; end;--引用declare cur1 SYS_REFCURSOR; i tgp_funds%rowtype; begin sql_test(cur1); loop fetch cur1 into i; exit when cur1%notfound; dbms_output.put_line('----------------:' || i.fnd_id);--fnd_id为表tgp_funds中的fnd_id 列 end loop; close cur1; end; 正解++
create or replace procedure sql_test(out_return out sys_refcursor) is
begin
open out_return for 'select * from tgp_funds';
end;--引用declare
cur1 SYS_REFCURSOR;
i tgp_funds%rowtype;
begin
sql_test(cur1);
loop
fetch cur1
into i;
exit when cur1%notfound;
dbms_output.put_line('----------------:' || i.fnd_id);--fnd_id为表tgp_funds中的fnd_id 列
end loop;
close cur1;
end;
create or replace procedure sql_test(out_return out sys_refcursor) is
begin
open out_return for 'select * from tgp_funds';
end;--引用declare
cur1 SYS_REFCURSOR;
i tgp_funds%rowtype;
begin
sql_test(cur1);
loop
fetch cur1
into i;
exit when cur1%notfound;
dbms_output.put_line('----------------:' || i.fnd_id);--fnd_id为表tgp_funds中的fnd_id 列
end loop;
close cur1;
end;
正解++
按照你的代码查询的结果还是在输出里面显示的呀。
我想要的结果是 执行存储过程显示的结果在SQL里面的。是像这样的结果。 能实现吗?