Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cursor curiosity

Re: Cursor curiosity

From: DA Morgan <damorgan_at_psoug.org>
Date: Sun, 14 May 2006 14:33:07 -0700
Message-ID: <1147642390.315299@bubbleator.drizzle.com>


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.org
Received on Sun May 14 2006 - 16:33:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US