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: Strange behaviour in PL/SQL (IF ignored)

Re: Strange behaviour in PL/SQL (IF ignored)

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 13 Sep 2001 14:23:13 +0100
Message-ID: <3ba0b345$0$225$ed9e5944@reading.news.pipex.net>


what is wrong with

begin
open atreecursor for select * ...
if aParentID != 0 then

      open aoffertypecursor
        for select a.product_id, ...

end if;

If I understand your requirements correctly

"Sascha Kiefer" <Sascha.Kiefer_at_PIKON.com> wrote in message news:4806fb87.0109120051.3a017cd7_at_posting.google.com...
> Hi,
>
> I've got a strange beaviour in the following piece of code:
>
> procedure ReadCatalogByParent (acustid in number,
> aprojid in number,
> ainstid in number,
> acatalogname in varchar2,
> alanguageID in varchar2,
> acountryID in varchar2,
> acustomergroupid in varchar2,
> aparentID in number,
> atreecursor out tree_cursor,
> aoffertypecursor out article_cursor,
> aerrornr out number,
> aerrormsg out varchar2) is
>
> begin
> if aParentID = 0 then
> open atreecursor for select * ...
> else
> open atreecursor for select *
> from ...
>
> open aoffertypecursor
> for select a.product_id, ...
> end if;
>
> When I call this procedure with aparentid = 0 the first open cursor in
> the if block is processed. Then the second open cursor in the else
> block is called ???
>
> I've tried to pack the second open cursor into an own if block with if
> aprentid=0 and this statement is just ignored (although parentid is 0,
> because in the first called it's correctly handled).
>
> The procedure on another oracle server is running correctly.
>
> Can somedbody tell me what's wrong with my oracle, or where we can
> start search ? Because I've got no idea what the problem is or where
> it comes from !!!
>
> Thanks in advance
>
> Sascha
Received on Thu Sep 13 2001 - 08:23:13 CDT

Original text of this message

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