给个例子给你;
CREATE OR REPLACE PACKAGE PKG_REFCURSOR IS
--存储过程取结果集所用的游标TYPE mycursor IS REF CURSOR;END PKG_REFCURSOR;
CREATE OR REPLACE PROCEDURE "UP_WJ_TEST"
( c_refcursor out pkg_refcursor.mycursor )is
begin
  open c_refcursor for  select * from hrms_emp;
end UP_WJ_TEST

解决方案 »

  1.   

    create or replace procedure finlib.finwip(Job varchar2,WipDate varchar2) is
    type type_cur is ref cursor;
       ResultCur type_cur; 
    begin 
      open ResultCur for
     SELECT 
      pod_job_no 祇虫,
      pod_part_code 絪絏,
      D.MTC_DESC  嘿,
      poc_ord_date8 祇ら戳,
      pod_order_qty 祇计秖,
      pod_unit_price 祇虫基,
      poc_currency 祇砯刽,
      POD_recvd_date8 Μ砯ら戳,
      SCC_CUST_CODE め絏,
      poc_vend_code 祇坝絏
      FROM IPORDP00 A ,IRESEP00 B,iporcp00 C,MRPLIB.IMTLCP00 D,sschcp00 E
      WHERE B.RES_JOB_NO = A.POD_JOB_NO
      AND A.POD_PO_NO = C.POC_PO_NO
      AND D.MTC_PART_CODE = A.POD_PART_CODE
      AND E.SCC_JOB_NO = SUBSTR(A.POD_JOB_NO,2,7)
      AND B.RES_MCAT ='WIP' 
      AND A.POD_COMPLETE = 'Y'
      and (a.pod_job_no = Job or Job is null)
      and (c.poc_ord_date8= WipDate or WipDate is null)
      ORDER BY poc_ord_date8 ;
      
      --Return ResultCur;
    end finwip;要不要 Retrun ResultCur ???
      

  2.   

    终于自己搞定了create or replace procedure finlib.finwip
    (
    ResultCur Out Sys_Refcursor

    isbegin
      open ResultCur for
      SELECT distinct
       * from A,B
    end finwip;