In following example, function returns the ref cursor based on the input parameter
CREATE OR REPLACE FUNCTION REF_CURSOR_TEST (P_DEPTNO NUMBER)
OPEN CUR_DEPT_COUNT FOR SELECT DEPTNO, COUNT(*) FROM EMP WHERE DEPTNO = P_DEPTNO GROUP BY DEPTNO;
PL/SQL block to handle the returned cursor
TCUR := REF_CURSOR_TEST(10);
FETCH TCUR INTO VDEPTNO, VDCOUNT;
EXIT WHEN TCUR%NOTFOUND;
NOTE: We do not need to open the cursor, as it is already open. But one should close it at the end.