How to dereference REF CURSOR on a non PL/SQL client?
rpatelAug 1 2007 — edited Aug 3 2007Hello,
I am stuck with this and I am not sure if what I want is possible. But here is the scenario.
I have a PL/SQL function, test_func(), which returns Employee records in a REF CURSOR.
I am calling test_func() using a simple SELECT as follows:
SELECT test_func() FROM Dual;
Instead of getting the Employee ResultSet, I get a pointer to the ResultSet, albeit as expected of REF CURSOR. My question is - is there a way I can formulate the SELECT on the client so as to retrieve the ResultSet directly instead of a pointer to the ResultSet? Interestingly, when I execute test_func() and print its results in SQLPlus, it auto-magically dereferences the REF CURSOR and displays the records in the ResultSet.
Please note that I do not have access to JDBC, and hence, CallableStatement. I have to use Java Persistence API, and hence, I am stuck with issuing SELECT on the client. Kindly throw any ideas you might have on my way.
Thanks and regards,
Rima.