I am using a cursor with a select statement from different tables.below is my cursor,
OPEN c_Txt FOR
SELECT PA.TEST_ID, EMP.EMP_TYP, EMP.EMP_FMLY_ID,EMP.EMP_SRGT_ID,EMP.EMP_TXT,EMP.FE B_CD,
FROM EMP_TEST PA
INNER JOIN EMP EMP
ON (EMP.EMP_SRGT_ID = PA.EMP_SRGT_ID)
AND (SYSDATE BETWEEN EMP.EMP_EFF_DT AND EMP.EMP_END_DT)
LEFT OUTER JOIN STYLE STYLE
ON (STYLE.STYLE_ID = EMP.STYLE_ID)
AND (SYSDATE BETWEEN STYLE.STYLE_EFF_DT AND STYLE.STYLE_END_DT)
LEFT OUTER JOIN EMP_FMLY PFMLY
ON (EMP.EMP_FMLY_ID = PFMLY.EMP_FMLY_ID)
AND (SYSDATE BETWEEN PFMLY.EMP_FMLY_EFF_DT AND PFMLY.EMP_FMLY_END_DT)
INNER JOIN V_CATLG_EMP CP
ON (EMP.EMP_SRGT_ID = CP.EMP_SRGT_ID)
AND (CP.CATLG_ID = 20)
AND (SYSDATE BETWEEN CP.CATLG_EMP_EFF_DT AND CP.CATLG_EMP_END_DT)
INNER JOIN EMP_EMP_QTY PPQ
ON (PPQ.EMP_SRGT_ID = EMP.EMP_SRGT_ID)
AND (SYSDATE BETWEEN PPQ.EMP_EMP_QTY_EFF_DT AND PPQ.EMP_EMP_QTY_END_DT)
INNER JOIN EMP_QTY PQ
ON (PPQ.EMP_QTY_ID = PQ.EMP_QTY_ID)
AND (SYSDATE BETWEEN PQ.EMP_QTY_EFF_DT AND PQ.EMP_QTY_END_DT)
WHERE (PA.TEST_ID IN ('1','2'))
AND (SYSDATE BETWEEN PA.EMP_TEST_EFF_DT AND PA.EMP_TEST_END_DT)
ORDER BY PA.TEST_ID';
This cursor declared as (c_Txt out ref_cursor).
I need to fetch only EMP_SRGT_ID from the above cursor,
I have used FETCH but it is expecting to fetch all the output from the cursor.
can use only OPEN FOR with the cursor since the cursor has to be one of the out parameter of my procedure.
Please help me to fetch only one output from a cursor.
Thanks for the reply... I need all the columns. The columns are used in the application when the cursor returned. But need to do some calculations in the procedure based on the EMP_SRGT_ID column value.