Hi,
I'm having trouble with using ref cursors. I want to process the individual rows
that are retrieved by a ref cursor. How do I do this?
I have this package.

CREATE OR REPLACE PACKAGE packGetInwardSummary
AS
TYPE typInward IS REF CURSOR;
FUNCTION funcGetInwardSummary(pOutInward OUT typInward)
RETURN NUMBER;
END packGetInwardSummary;
/

CREATE OR REPLACE PACKAGE BODY packGetInwardSummary
AS
FUNCTION funcGetInwardSummary(pOutInward OUT typInward)
RETURN NUMBER
IS
BEGIN
OPEN pOutInward FOR
SELECT i.inw_id,
i.inw_source_name,
k.doc_type,
i.inw_stage_of_document,
i.inw_added_by,
i.inw_added_dt,
i.inw_status
FROM inward i,
knowledge_mgmt k
WHERE i.inw_id = k.inw_id
AND k.knw_file_title IS NULL;
RETURN 0;

EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE ('Exception while retrieving the inward summary.');
RETURN 1;
END funcGetInwardSummary;
END packGetInwardSummary;
/

In the above select in the package body, I get the doc type from the knowledge_mgmt table.
I have another table named document_type which holds the document name. For each of the
doc_type retrieved by the ref cursor, I want to get the document name from the document_type table and pass it as a part of the output parameter (a part of the ref cursor output itself). i.e in the o/p instead of the doc_type being part of the ref cursor o/p (pOutInward), I want the document name as part of the ref cursor o/p(pOutInward).
How do I do this?

Thanks a lot in advance.
PC