Home » SQL & PL/SQL » SQL & PL/SQL » Select * & REF CURSOR in pl sql
Select * & REF CURSOR in pl sql [message #4474] Thu, 12 December 2002 17:08 Go to next message
Rob
Messages: 70
Registered: January 2000
Member
I have the following procedure:

Create or replace procedure test (
return_cur OUT type.ref_cursor
) IS
BEGIN
Open return_cur FOR SELECT * from testTable;
END;

(my type.ref_cursor is just defined as REF CURSOR)

My question is 2 parts:
1) if done this way, do I need to close my cursor explicitly (and how do I do it, keeping a result set output)
2) is there a more efficient way to do this? I need to dump the entire contents of a table to a result for the purpose of building a cache (hashtable) in java.

Thanks,
Rob Simpson
Re: Select * & REF CURSOR in pl sql [message #4475 is a reply to message #4474] Thu, 12 December 2002 17:14 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You will need to close the cursor in Java when you are done fetching from it.

This is absolutely the correct/best way to return the table contents to a calling program.
Previous Topic: How to Query a cursor
Next Topic: Table Size
Goto Forum:
  


Current Time: Thu May 16 08:31:38 CDT 2024