General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 12th, 2004, 02:20 PM
tomahawk009 tomahawk009 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 tomahawk009 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
geeting complete dataset for a Cursor in a cursor for loop

have a stored proc which returns a ref cursor.
a cursor C1 in the proc. is used for looping and getting info and putting into another cursor C2 of type ref cursor.Now it works fine except for the part that the inside cursor C2 holds values only for the last cursor loop in C1.So invariably the data is over written and my desired dataset in not aquired.

Both the indiviual queries for the cursor are fine

what is the workaround ? how to i keep appending the inner cursor ?


Please help!

sample code
[CODE]

TYPE t_cursor IS REF CURSOR;

procedure hello(abc IN number ,xyz IN varchar,S_cursor OUT T_CURSOR) IS
v_cursor t_cursor;

cursor c1 is select l from l_a where v_u = 'xyz';
begin
FOR j IN c1
LOOP
open v_cursor for
SELECT D as ID,c,S0 FROM S, L7
WHERE L7.mn IS NULL
AND L7.L = j.l;

END loop;
S_cursor := v_cursor ;
END hello;

[CODE]

Reply With Quote
  #2  
Old October 16th, 2004, 03:16 AM
michlmann michlmann is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 56 michlmann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
Perhaps:

Code:
   
  TYPE t_cursor IS REF CURSOR;
   
  procedure hello(abc IN number ,xyz IN varchar,S_cursor OUT T_CURSOR) IS 
  v_cursor t_cursor;
   
 begin
 open v_cursor for
  SELECT D as ID,c,S0 FROM S, L7, (select l from l_a where v_u = 'xyz') x
  WHERE L7.mn IS NULL 
  AND L7.L = x.l;
   S_cursor := v_cursor ;
  END hello;
  

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > geeting complete dataset for a Cursor in a cursor for loop


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap