Method R
Welcome, Guest
Please Login or Register.    Lost Password?
Assigning results of explicit cursor to ref cursor (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Assigning results of explicit cursor to ref cursor
#138
DennisF (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
Assigning results of explicit cursor to ref cursor 11 Months, 3 Weeks ago  
I would greatly appreciate any help with the following:

CURSOR get_emp IS SELECT * FROM EMPLOYEE;
TYPE type_rc is REF CURSOR;
out_rc type_rc;

I want to RETURN out_rc in my function. How do I get the results of the explicit cursor get_emp into the cursor variable out_rc?
I don't thonk a simple assignment will work as in
out_rc := get_emp beacuse one is a ref cursor and the other a cursor
I know I could create a nested table say nest_tab with a CREATE statement outside of this function, put the rows from the get_emp rows into the nested table and then do a OPEN out_rc FOR SELECT FROM TABLE(nest_tab)

But is there a more simpler way to do this and avoid the movement of the rows via the nested table? Also this a high concurrency application and even this extra movement of data via the nested table will cost us dearly.

Thanks in anticipation.
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/09/20 15:18 By DennisF.
  The administrator has disabled public write access.
      Topics Author Date
    thread link
Assigning results of explicit cursor to ref cursor
DennisF 2009/09/19 09:38
    thread link
thread linkthread link Re:Assigning results of explicit cursor to ref cursor
jholt 2009/09/21 07:44
    thread link
thread linkthread link Re:Assigning results of explicit cursor to ref cursor
DennisF 2009/09/21 08:38
    thread link
thread linkthread linkthread link Re:Assigning results of explicit cursor to ref cursor
jholt 2009/09/21 08:41
    thread link
thread linkthread link Why would the SQL text have to be in two places
DennisF 2009/09/21 09:14
    thread link
thread linkthread linkthread link Re:Why would the SQL text have to be in two places
jholt 2009/09/21 09:15
    thread link
thread linkthread linkthread linkthread link Re:Why would the SQL text have to be in two places
roncrisco 2009/09/21 10:07
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
Home Forum
Joomla Templates by Joomlashack