学习视频:http://www.imooc.com/video/7297
1.打开PLSQL ,连接oracle数据库,声明一个包结构
包头:
create or replace package Mypackage as
type usercursor is ref cursor; --type 关键字声明类型,将usercursor 定义为光标 cursor 类型
procedure queryUserList(uid in number,userList out usercursor); --一个存储过程名字
end mypackage;
包体:需要实现包头中声明的所有方法
create or replace package body myPackage as
procedure queryUserList(uid in number,userList out usercursor)
as
begin
--打开光标
open userList for select * from USER_TEST where user_id = uid ;
end queryUserList;
end mypackage;
2.在 PLSQL 中查看包结构: