Re: functions in packages

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Thu, 13 Feb 2003 06:35:57 -0800
Message-ID: <3E4BAD4D.B10C10EB_at_exesolutions.com>


Scott Mattes wrote:

> Isn't the problem here that because overloading is allowed the compiler is
> looking not for the original last_cap (without params), but an entirely
> different last_cap with one param??????
>
> "FC" <flavio_at_tin.it> wrote in message
> news:ZGL2a.233964$AA2.9062774_at_news2.tin.it...
> >
> > "DA Morgan" <damorgan_at_exesolutions.com> wrote in message
> > news:3E4B283F.2AE2DDEE_at_exesolutions.com...
> > > Dwayne wrote:
> > >
> > >> ....
> > > > Warning: Package Body created with compilation errors.
> > > >
> > > > SQL> show error
> > > > Errors for PACKAGE BODY CAP:
> > > >
> > > > LINE/COL ERROR
> > >
> >
> > -------- -----------------------------------------------------------------
> > > > 3/10 PLS-00323: subprogram or cursor 'LAST_CAP' is declared in a
> > > > package specification and must be defined in the package body
> > > >
> > > > I spent 3 hours on this trying different combos but nothing.
> > >
> > > There is no relationship between what you have written in the package
> > header
> > > and the function in the package body. The package header does not
> > reference
> > > your input parameter NAME VARCHAR2.
> > >
> > > Daniel Morgan
> > >
> >
> > For the sake of intellectual honesty, I've always found that error message
> > very misleading.
> > If the problem lies in a wrong argument count, I wonder why the error
> > message isn't saying "Wrong argument count" or "Bad function
> specification"
> > or alike.
> > On the other hand the parser works like that since ages, so, at the end of
> > the day, there is very little room for complaints, just take it as it is
> and
> > run...
> >
> > Bye,
> > Flavio
> >
> >

Partially right in that because of overloading the compiler only knows that the function specified in the package header doesn't exist in the package body. The other half of the issue is that packages can contain local functions and procedures so a function in the package body that does not exist in the header is syntactically valid.

Daniel Morgan Received on Thu Feb 13 2003 - 15:35:57 CET

Original text of this message