Category Archives: Oracle PL/SQL

Oracle PL/SQL programming

Returning cursor from PL / SQL objects

In following example, function returns the ref cursor based on the input parameter CREATE OR REPLACE FUNCTION REF_CURSOR_TEST (P_DEPTNO NUMBER)RETURN SYS_REFCURSORISCUR_DEPT_COUNT SYS_REFCURSOR; BEGINOPEN CUR_DEPT_COUNT FOR SELECT DEPTNO, COUNT(*) FROM EMP WHERE DEPTNO = P_DEPTNO GROUP BY DEPTNO;RETURN CUR_DEPT_COUNT;END;/ PL/SQL block … Continue reading

Posted in Oracle PL/SQL | Tagged | Leave a comment