Hey guys, we're trying to get a ref cursor back from a PL/SQL procedure, and the procedure function looks like this:

PROCEDURE select_recall_history
(p_doc_id IN VARCHAR2, p_recall_cv IN OUT recall_cur_typ)
IS
BEGIN
OPEN p_recall_cv for
SELECT DOCUMENT_ID, DOCNO, documentID, to_char(PROCESS_DATE, 'MM/DD/YYYY HH24:MI:SS') PROCESS_DATE, REASON, STATUS, DOR_TOR FROM RECALL
connect by DOCUMENT_ID = prior documentID
start with document_id IN (p_doc_id)
UNION
SELECT DOCUMENT_ID, DOCNO, documentID, to_char(PROCESS_DATE, 'MM/DD/YYYY HH24:MI:SS') PROCESS_DATE, REASON, STATUS, DOR_TOR FROM RECALL
connect by prior DOCUMENT_ID = documentID
start with documentID IN (p_doc_id);
END;


We're trying to execute a PL/SQL statement (select.....) and get a record set back, in a C++ program. We've got a connection to the database, and had it working if we send the SQL command to the database directly( using a recordset->open(...) call,) but we want to switch to a procedure. We learned about the command object, and setting it up with the creating parameter, and appending those to the command object, but we don't know how to handle the recordset coming back.

We are not sure what to append for the ref cursor parameter before we execute. We keep getting error's in the catch part. Any help is appreciated. Thank you.