2009. 4. 20. 10:59
Oracle의 Package에서 RecordSet 받기 Work/ORACLE2009. 4. 20. 10:59
Oracle은 Stored Procedure 에서 SELECT로 Record Set을 받아서 사용하려면 아래처럼 Package를 사용해야 한다.
CREATE OR REPLACE PACKAGE PKG_RECORDSET IS
TYPE RECORDSET IS REF CURSOR;
PROCEDURE up_Pkg_RecordSet
(
nParam NUMBER
);
END PKG_RECORDSET;
/
CREATE OR REPLACE PACKAGE BODY PKG_RECORDSET IS
PROCEDURE up_Pkg_RecordSet
(
nParam NUMBER
)
IS
BEGIN
OPEN pRECORDSET FOR
SELECT Columns1, Columns2
FROM Tables1
WHERE Columns3 = nParam;
END;
END PKG_RECORDSET;
/