Oracle 建立包 和 包体

--创建包
create or replace package  pac_stu
as
  type cur_stu is ref cursor;
  procedure getStu(i in number,cur_stu out cur_stu);
end pac_stu;
--创建包体
create or replace package body pac_stu
as
procedure getStu(i in number,cur_stu out cur_stu)
  as
  nums number(10);
  begin
    select count(*) into nums from stu;    
    if nums > 0 then    
      open cur_stu for select * from stu;     
    end if;   
  end getStu;
end pac_stu;
posted @ 2013-07-28 23:55  roscee  阅读(1570)  评论(0编辑  收藏  举报