文章作者 100test 发表时间 2007:05:15 12:19:09
来源 100Test.Com百考试题网
以下是返回两个结果集(全部 EMPLOYEES 和 JOBS 记录)的包规范:
CREATE OR new PACKAGE SELECT_EMPLOYEES_JOBS AS
TYPE T_CURSOR IS REF CURSOR.
PROCEDURE GetEmployeesAndJobs (
cur_Employees OUT T_CURSOR,
cur_Jobs OUT T_CURSOR
).
END SELECT_EMPLOYEES_JOBS.
包正文如下所示:
CREATE OR new PACKAGE BODY SELECT_EMPLOYEES_JOBS AS
PROCEDURE GetEmployeesAndJobs
(
cur_Employees OUT T_CURSOR,
cur_Jobs OUT T_CURSOR
)
IS
BEGIN
-- return all EMPLOYEES records
OPEN cur_Employees FOR
SELECT * FROM Employees.
return all JOBS records
OPEN cur_Jobs FOR
SELECT * FROM Jobs.
END GetEmployeesAndJobs.
END SELECT_EMPLOYEES_JOBS.