Part of the code must be missing because plan_id cursor is being
open/fetched but NOTHING done with it.

Rick

-----Original Message-----
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 02, 2001 2:29 PM
To: Multiple recipients of list ORACLE-L



The reasons this doesn't work are fairly numerous.  What is it you're
trying to accomplish here?  Perhaps if you could explain your requirement,
somebody could help you out.  I'm quite surprised you were able to get a
version of this to compile and run even if you did use a 'FOR' loop.  Is it
possible we're not seeing all the code?


David A. Barbour
Oracle DBA, OCP
AISD
512-414-1002


 

                    "Feng, Jun"

                    <jfeng@verisig       To:     Multiple recipients of list
ORACLE-L <[EMAIL PROTECTED]>  
                    n.com>               cc:

                    Sent by:             Subject:     Repost: Nested loop in
PL/SQL                           
                    [EMAIL PROTECTED]

                    om

 

 

                    10/02/2001

                    10:05 AM

                    Please respond

                    to ORACLE-L

 

 





Sorry, I meant to say doesn't work.

-----Original Message-----
Sent: Monday, October 01, 2001 6:50 PM
To: Multiple recipients of list ORACLE-L


Could anyone tell me why following nested loop does work? It stopped after
inner loop finished. I tried for loop, it worked ok.

Thanks,

Jun

declare v_plan_id number;
        v_channel_id pricing_plan.channel_id%TYPE;
        v_row pricing_plan%ROWTYPE;
cursor plan_id is
select distinct pricing_Plan_id from pricing_plan
where CHANNEL_ID = 'GROUP19'
and promotion_cd = 'INFO'
and trunc(end_date) >= trunc(sysdate)
and p_mode = 'LIVE'
group by PRICING_PLAN_ID;

cursor channel_id is
select  distinct channel_id  from pricing_plan
where CHANNEL_ID not in ('GROUP1','GROUP2', 'GROUP3')
and transaction_type = 'REGISTRATION'
order by channel_id;


begin
open plan_id;
open channel_id;
loop
fetch plan_id into v_plan_id;
exit when plan_id%NOTFOUND;

loop
fetch channel_id into v_channel_id;
exit when channel_id%NOTFOUND;

        select * into v_row
        from pricing_plan
        where PRICING_PLAN_ID = 1;

dbms_output.put_line(v_row.price_cd);

end loop;
end loop;
close plan_id;
close channel_id;
end;
/
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Feng, Jun
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Feng, Jun
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Cale, Rick T (Richard)
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to