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: PL/SQL Function Name Declaration

Re: PL/SQL Function Name Declaration

From: kong <kongkong99_at_yahoo.com>
Date: 19 May 2004 20:29:12 -0700
Message-ID: <cc50806d.0405191929.5dcd931c@posting.google.com>


Hi Gary Menchen ,

Thanks for ur help.
Yes, i do declare the function. When i declare it wihtin the body, it prompt error. When i declare it in the spec, no erro occurs... but i only want this function to be declare in my body, that is the problem... i do not understand why should it be decalered in the spec??

For more infor, i will use this function within my sql statement. exmple: select * from tableA where functionA(name)='abc'

may i know how to solve this problem or is there any other option? i need more understanding in this topic..

thanks n regards,
kong

Gary Menchen <gary.e.menchen_at_dartmouth.edu> wrote in message news:<c8fh85$ema$1_at_merrimack.Dartmouth.EDU>...
> kong wrote:
> > Hi,
> >
> > I have created a function and coded it within a Package. At first, I
> > declared this function name at package body. It prompted error when i
> > tried to use this function in a sql (within that package). The error
> > is "This function may not be used in sql".
> >
> > However, it is working fine when i declare the function at package
> > specification. May I know why such occurrence happened? Any solutions
> > for this as I do not want to declare it at package specification.
> >
> > Thanks in advance.
>
> If a function is declared only in a package body then it can be used
> only within that function body - in fact in the function body it can
> only be referenced in code that appears after the function unless there
> was a forward declaration.
Received on Wed May 19 2004 - 22:29:12 CDT

Original text of this message

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