SQL> create or replace package Test is
2 type mycursor is ref cursor; -- 定义游标变量
3 procedure GetRecord(r_c out mycursor); -- 定义过程,用游标变量作为返回参数
4 end TestPackage;
5 /SQL> create or replace package body Test is
2 procedure GetRecord(r_c out mycursor) as
3 begin
4 open rcursor for select nvl(pathname,' ') from t1,t2 where t1.crc=t2.crc(+);
5 end GetRecords;
6 end TestPackage;
7 /

解决方案 »

  1.   

    open r_c for select nvl(t2.pathname,' ') from t1,t2 where t1.crc=t2.crc(+);
      

  2.   

    SQL> create or replace package Test is
    2 type mycursor is ref cursor; 
    3 procedure GetRecord(r_c out mycursor); 
    4 end Test ;
    5 /SQL> create or replace package body Test is
    2 procedure GetRecord(r_c out mycursor) as
    3 begin
    4 open r_c for select nvl(t2.pathname,' ') from t1,t2 where t1.crc=t2.crc(+);
    5 end GetRecord;
    6 end Test ;
    7 /
    老写错