Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to dereference REF CURSOR on a non PL/SQL client?

rpatelAug 1 2007 — edited Aug 3 2007
Hello,

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2007
Added on Aug 1 2007
14 comments
1,061 views