when no rows returned in the for loop query, Replace Null - Need Help
627574Aug 19 2011 — edited Aug 19 2011Hi,
I have a requirement where I have a query in the for loop and based on the query results, I am doing some operations.
But, even though the query does not have a match, I should return something like 'No Data'.
My for loop is:
FOR V_SL IN (
SELECT ID,CATEGORY,DI_CD,REV_CD,SL_ID
FROM SLOT_DATA SB, SLOT_2001 S2 WHERE
SB.BENEFIT_ID = S2.BENEFIT_ID AND
REV_CD = IN_REV_CD AND
(PROC_CD IS NULL OR PROC_CD = IN_PROC_CD)
ORDER BY DIAGCODE, PROCEDURECODE)
LOOP
END LOOP;
I am doing some operations inside the for loop. I want the loop to get executed even though the query doesn't return any rows.
Can anybody help me here.
Thanks,
Raghu