Re: Functions

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 21 Feb 2009 10:03:15 -0700
Message-ID: <49a041e3$1_at_news.victoria.tc.ca>



Robert Klemme (shortcutter_at_googlemail.com) wrote:
: On 20.02.2009 22:03, gym dot scuba dot kennedy at gmail wrote:
: > "Mtek" <mtek_at_mtekusa.com> wrote in message 
: > news:c468a5f4-da3f-4027-99db-1f528bbf27d7_at_m40g2000yqh.googlegroups.com...

: >> This is interesting. Say I have a package with a function in it. The
: >> function is local to that package only and is not called from the
: >> outside.

: Here you have provided the explanation yourself.

Hardly. After all, the sql statement has access to variables that are private but within scope. It isn't obvious why it should not also have access to other things that are in scope within the package.

Basicaly that is a limitation of the implementation of pl/sql. For the sql to have access to the function the function must be visible outside of the package.

Types are a bit like that also. You can create a type that is local to a package, but then Oracle actually creates a type outside of the package using a system generated name so that the sql statements in the package can appear to be accessing the type that is private to the package. But if you drop the system generated type then you'll quickly earn which type was actually being accessed (and it isn't the thing in the package).

Oracle doesn't do anything like that for functions though, you have to do it yourself by making them visible and then using the full name. Received on Sat Feb 21 2009 - 11:03:15 CST

Original text of this message