查询某个部门中所有员工的所有信息
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
procedure queryEmpList(dno in number,empList out empcursor) AS
BEGIN
open empList for select * from emp where deptno=dno;
END queryEmpList;
END MYPACKAGE;
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
procedure queryEmpList(dno in number,empList out empcursor) AS
BEGIN
open empList for select * from emp where deptno=dno;
END queryEmpList;
END MYPACKAGE;
本文介绍了一个PL/SQL包,用于查询指定部门内所有员工的详细信息。通过定义一个游标类型并创建一个过程来实现这一功能,该过程接收部门编号作为输入参数,并返回一个包含查询结果的游标。
3335

被折叠的 条评论
为什么被折叠?



