Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL Function Name Declaration
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 - 06:41:09 CDT
![]() |
![]() |