CREATE OR REPLACE PACKAGE 你的包名
AS
   TYPE myrctype IS REF CURSOR;   procedure sms_GetSendInfo(p_rc OUT myrctype);
END;
/CREATE OR REPLACE PACKAGE BODY 你的包名
AS
  procedure sms_GetSendInfo (p_rc OUT myrctype)
  as
  minautoid int default 0;
  sqlstr varchar2(100);
  begin
    select max(autoid) into minautoid from sms_interface;
    sqlstr:='select autoid ,mobile,mobilepayed,servicetype,feetype,feevalue,moflag,content,spnumber from sms_interface where autoid =:minautoid';
    OPEN p_rc FOR sqlstr USING minautoid;
    insert into sms_interface_history select * from sms_interface where autoid=minautoid;
    delete sms_interface where autoid=minautoid;
    commit;
  end;
end;
/

解决方案 »

  1.   

    create package test_pack
    as
    type t_rc is ref cursor;
    end;
    /
    create or replace procedure sms_GetSendInfo(p_rc out test_pack.t_rc)
    as
    minautoid number:=0;
    begin
    select min(autoid) into  minautoid  from sms_interface;
    open p_rc for 
    select autoid ,mobile,mobilepayed,servicetype,feetype,feevalue,moflag,content,spnumber from sms_interface where autoid = minautoid;insert into sms_interface_history select * from sms_interface where autoid=minautoid;
    delete sms_interface where autoid=minautoid;
    commit;
    exception
    when others then
    rollback;
    end;
    /