Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00382 when call a function in the same package
PLS-00382 when call a function in the same package [message #39378] Fri, 12 July 2002 09:39 Go to next message
George
Messages: 68
Registered: April 2001
Member
Hi,

I have 2 functions in a package pak1, function (f1) returns a number (count(*)). I get PLS-00382 when I do this in the function (f2) :

f2 ...
select colA, pak1.f1(parameters) as Total
/* OR select colA, f1(parameters) as Total */
from ...

Does it means I can't call a function in the same package? How can I fix this?

Thanks
Re: PLS-00382 when call a function in the same package [message #39379 is a reply to message #39378] Fri, 12 July 2002 10:28 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
No, it is not a problem to do this. It sounds like you have a datatype mismatch somewhere.

sql>create or replace package foo
  2  is
  3    function f1(p_in in number) return number;
  4    function f2(p_in in number) return number;
  5  end;
  6  /
 
Package created.
 
sql>create or replace package body foo
  2  is
  3    function f1(p_in in number)
  4      return number
  5    is
  6    begin
  7      return (p_in * 2);
  8    end;
  9    
 10    function f2(p_in in number)
 11      return number
 12    is
 13      v_value number;
 14    begin
 15      select f1(p_in) * 2
 16        into v_value
 17        from dual;
 18        
 19      return (v_value);  
 20    end;
 21  end;
 22  /
 
Package body created.
 
sql>select foo.f1(1), foo.f2(2) from dual;
 
FOO.F1(1) FOO.F2(2)
--------- ---------
        2         8
Re: PLS-00382 when call a function in the same package [message #39383 is a reply to message #39378] Fri, 12 July 2002 14:40 Go to previous message
George
Messages: 68
Registered: April 2001
Member
Thanks

What I did is calling f1 from inside f2. Does this possible?

Thanks
Previous Topic: ASP - Oracle Cursor not ready for I-O
Next Topic: Re: Formatting body of mail sent by utl_smtp
Goto Forum:
  


Current Time: Sun Jul 21 16:25:29 CDT 2019