I have 2 different procedures with 2 different select statements. I need to be able to pass the ref cursor to a function or stored procedure for addition processing.

Example

Procedure 1:
Type OutCursor ref cursor;
OutCursor pCursor;

Begin

OPEN pCursor FOR
select Lname, Fname, City, State, Zip
from Client;

TestFunction(pCursor);
End;

Procedure 2:
Type OutCursor ref cursor;
OutCursor pCursor;

Begin

OPEN pCursor FOR
select Lname, Fname, StreetA, StreetB
from Client;

TestFunction(pCursor);
End;

TestFunction
(pCursor IN OutCursor)
IS

Begin

--Here is where I run into the problem. I need to be able to pull the Lname, Fname from the 2 different select statements. I don’t care how it is done, I just need to be able to loop through the cursor and put the Lname and Fname into variables.


End;

Thanks for the help.