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

Home -> Community -> Usenet -> c.d.o.server -> Re: Circular reference with private procedures in package

Re: Circular reference with private procedures in package

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: Wed, 02 Jul 2003 18:35:20 +0000
Message-ID: <3068061.1057170920@dbforums.com>

Originally posted by Leo J. Hart IV
> Circular reference with private procedures in package
>
> Hello! Here's my question...
>
> The following package will not compile because of a circular reference
> between inner1 and inner2. Because private functions need to be placed
> in a specific order and inner1 and inner2 are inter-dependant, there
> doesn't seem to be a way to get this package to compile other than
> making INNER1 public. Is there anything else I can do?
>
>
> CREATE OR REPLACE
> PACKAGE test_pkg
> IS
> /********************************************************************-
> ******************************/
> FUNCTION OUTER(
> pNumber IN NUMBER
> )
> RETURN NUMBER;
>
> /********************************************************************-
> ******************************/
> END;
> /
>
>
> CREATE OR REPLACE
> PACKAGE BODY test_pkg
> IS
> /********************************************************************-
> ******************************/
> FUNCTION INNER2(
> pNumber IN NUMBER
> )
> RETURN NUMBER
> IS
> lNumber NUMBER;
> BEGIN
> lNumber := pNumber + 1;
>
> IF lNumber < 10 THEN
> lNumber := INNER1(lNumber);
> END IF;
>
> RETURN lNumber;
> END;
>
> /********************************************************************-
> ******************************/
> FUNCTION INNER1(
> pNumber IN NUMBER
> )
> RETURN NUMBER
> IS
> lNumber NUMBER;
> BEGIN
> lNumber := pNumber + 1;
>
> IF lNumber < 10 THEN
> lNumber := INNER2(lNumber);
> END IF;
>
> RETURN lNumber;
> END;
>
> /********************************************************************-
> ******************************/
> FUNCTION OUTER(
> pNumber IN NUMBER
> )
> RETURN NUMBER
> IS
> lNumber NUMBER;
> BEGIN
> lNumber := INNER1(pNumber);
> RETURN lNumber;
> END;
> /********************************************************************-
> ******************************/
> END;
> /

Yes. Change your code logic. Both inner1 and inner2 are identical calling one from the other. Not sure what's your reason behind this logic.

Regards
/Rauf Sarwar

--
Posted via http://dbforums.com
Received on Wed Jul 02 2003 - 13:35:20 CDT

Original text of this message

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