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: Can't use FUNCTION in SQL?

Re: Can't use FUNCTION in SQL?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 31 Aug 1999 11:52:21 GMT
Message-ID: <37cbc19e.4609748@newshost.us.oracle.com>


A copy of this was sent to hlh_nospam_at_excite.com (Howard Lee Harkness) (if that email address didn't require changing) On Mon, 30 Aug 1999 20:42:12 GMT, you wrote:

>On Sat, 28 Aug 1999 18:30:18 GMT, tkyte_at_us.oracle.com (Thomas Kyte)
>wrote:
>
>>in Oracle8.0 and before you have to assert the purity level of packaged
>>procedures and functions.
>
>Oops. I stumbled across purity level before, and just failed to
>recall it. Plus, the compiler error didn't contain any really good
>hints that that was the problem. Next time, maybe I'll recognize the
>problem when I encounter it.
>
>OK. That worked, although not exactly the way I had in mind.
>
>PL/SQL apparently requires the purity pragma to be in the package
>header. Unless I am missing something else, this requires the
>functions that I wanted to use to be accessible outside the package.
>I originally coded these functions local to another procedure (i.e.,
>nested).
>
>I don't suppose there is a way to specify the purity level of a nested
>function, is there??
>

they need to be in the specification if you want to call them from SQL anyway. even of the sql invoking these functions was buried in the same package its at a totally different scope anyway.

In order for a function to be callable from SQL, it must be a top level, visible function -- it cannot be hidden in the package itself.

>hlh_NOSPAM_at_excite.com is a valid, unmunged address!
>It is also so full of spam(!) that I don't read it.

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Aug 31 1999 - 06:52:21 CDT

Original text of this message

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