oracle建游标变量包,且在存储过程中使用

前端之家收集整理的这篇文章主要介绍了oracle建游标变量包,且在存储过程中使用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
--建包
createorreplacepackage PA_BGYZB as
type sp_cursor is ref cursor;
end PA_BGYZB;



--存储过程调用包
create or replace procedure PRO_GETYFBGYZB(jgidInput  in varchar2,yfsbInput  in varchar2,--输入变量
                                           bgyzb_cursor out PA_BGYZB.sp_cursor
                                    ) as
  ypxh1 NUMBER( 18);
  ypcd1 NUMBER( 18);
  ypsl1 NUMBER( 10,4 );
  ypgg1 VARCHAR2( 200);
  lsje1 NUMBER( 12,4 );
begin
     open bgyzb_cursor for select a.ypxh as YPXH,a.YPCD,a.ypsl,b.yfgg,a.lsje 
  into ypxh1,ypcd1,ypsl1,ypgg1,lsje1
    from yf_kcmx a,yf_ypxx b
   where a.jgid = b.jgid
     and a.yfsb = b.yfsb
     and a.ypxh = b.ypxh
     and a.jgid = jgidInput
     and a.yfsb = yfsbInput;
end PRO_GETYFBGYZB;
原文链接:https://www.f2er.com/oracle/212154.html

猜你在找的Oracle相关文章