|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
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] |
|
#2
|
|||
|
|||
|
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; |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > geeting complete dataset for a Cursor in a cursor for loop |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|