示例如下:
create or replace package MyPackage as
type ReCursor is ref cursor;
end MyPackage;create or replace procedure MyPro (outcur out Mypackage.ReCursor) is
begin
open outcur for
select * from table_test where id<=3;
end;我想直接在sqlplus命令行中查看结果(不是从外部程序调用),就是:
SQL>该怎么写?这个报错:
declare aa MyPackage.ReCursor%rowtype;
begin
exec aa := Mypro;
end;刚接触Oracle,请大家指教
create or replace package MyPackage as
type ReCursor is ref cursor;
end MyPackage;create or replace procedure MyPro (outcur out Mypackage.ReCursor) is
begin
open outcur for
select * from table_test where id<=3;
end;我想直接在sqlplus命令行中查看结果(不是从外部程序调用),就是:
SQL>该怎么写?这个报错:
declare aa MyPackage.ReCursor%rowtype;
begin
exec aa := Mypro;
end;刚接触Oracle,请大家指教
declare aa MyPackage.ReCursor%rowtype;
begin
exec Mypro(aa);
end;
这个报错
begin
open cur_out for 'select * from emp';
end;
/
然后在plsql中:
SQL> var results refcursorSQL> exec sp_fetchdata(results);SQL> print results;
begin
exec Mypro(aa);
end;
--打印过程中out参数的内容
print aa;