Check if the cursor contains something or not?
I want to check a cursor contains something or not in a procedure, before return it. If nothing inside the cursor, I would like do something else (for example, load other data record to the cursor). I don't want to pass back a empty cursor (please see the code as following part).
What is the best way to check the io_curArchiveData cursor contains something or not ?
------------------------------------------------------- code
PROCEDURE Get_Archive_Data(
in_numArchiveID IN NUMBER,
io_curArchiveData IN OUT udt_ref_cur )
IS
BEGIN
-- Get record
OPEN io_curArchiveData FOR
SELECT ASM.archive_nm,
ASM.date_created,
ASM.created_by_id
FROM IQUASR.ASUBMISSION ASM
WHERE ASM.archive_id = in_numArchiveID;
-- Check io_curArchiveData contains something or not ???
-- If nothing in io_curArchiveData, do something.
......