举例:查询某个部门中的所有员工信息 ---> 返回集合
包头
CREATE OR REPLACE PACKAGE MYPACKAGE AS
type empcursor is ref cursor; //自定义一个集合类型
procedure queryEmpList(dno in number,empList out empcursor);
END MYPACKAGE;
包体
CREATE OR REPLACE PACKAGE BODY MYPACKAGE AS
//将集合类型的参数作为out参数传入
procedure queryEmpList(dno in number,empList out empcursor) AS
BEGIN
open empList for select * from emp where deptno=dno;
END queryEmpList;
END MYPACKAGE;