Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Cursor curiosity
Dereck L. Dietz wrote:
> I have the following code in a program which will work if the outer cursor
> isn't sent a parameter as part of the procedure call. If no parameter is
> put in the code then the inner cursor will work and pick up data. However,
> IF a parameter is put in the code then the inner cursor doesn't pick
> anything up.
>
> The procedure is being written using Oracle 9i version 2 on a Windows XP Pro
> platform.
>
> Any ideas?
>
> PROCEDURE team_hist ( p_team IN team.team%TYPE )
> IS
>
> CURSOR cr_team ( p_team IN team.team%TYPE )
> IS
> ...
>
> CURSOR cr_team_history ( p_team IN team_history.team%TYPE )
> IS
> ...
>
> BEGIN
>
> FOR c1 IN cr_team ( p_team ) <=== will work if ( p_team ) not in code
> LOOP
>
> ...
>
> FOR c2 IN cr_team_history ( c1.team )
> LOOP
>
> ...
>
> END LOOP;
>
> END LOOP;
>
> END team_hist;
Two comments. (1) Why did you post this and (2) why are you writing cursor loops in Oracle 9i? They are obsolete.
Look at the demos of bulk collection in Morgan's Library at www.psoug.org.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Sun May 14 2006 - 16:33:07 CDT
![]() |
![]() |