Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Calling a function from a view

Re: Calling a function from a view

From: Les Phillips <lesp_at_deakin.edu.au>
Date: 1997/04/18
Message-ID: <33571771.49C8@deakin.edu.au>#1/1

Thanks for your reply,
Just thought I would let other interested parties that I have followed this up with Oracle Support and they are able to supply a patch that can be applied to Server 7.3.2.3

Les.

Solomon.Yakobson_at_entex.com wrote:
>
> Your problem is not view related. In order to use a user function
> from SQL it can not modify any database objects. Your function
> calls a stored procedure which in its turn calls Oracle supplied
> package DBMS_PIPE. One of the differences between standalone and
> packaged function/procedure is that standalone function/procedure
> is compiled every time you reference it. Therefore, when it is
> called from SQL Oracle knows to check if it is changing database
> state. Packaged are stored already compiled. Therefore, if you
> intend to use packaged function/procedure from SQL, you need to
> indicate it in package specification by using RESTRICT_REFERENCES
> pragma (Application Developer's Guide, Chapter 6: Using Procedures
> and Packages, Section: Calling Stored Functions from SQL
> Expressions). Unfortunately, all Oracle provided packages do not
> include PRAGMA RESTRICT_REFERENCES for any function/procedure that
> does not "write any database state". As a result you can not
> reference any Oracle provided packages in a function you intend to
> use from SQL. I filed this issue to Oracle support about a year
> ago and response was Oracle 8. I guess we have to wait couple more
> months to find out if it is the case.
>
> Solomon.Yakobson_at_entex.com
>
> In article <33544B6E.17A8_at_deakin.edu.au>,
> lesp_at_deakin.edu.au wrote:
> >
> >
> > Summary:
> >
> > Cannot create a view that calls a function that writes to
> > a pipe. The following error occurs -
> >
> > ORA-06571: Function FUNCTION_X does not guarantee not to update
> > database.
> >
> > Can the view be forced to use the function?
> >
  Received on Fri Apr 18 1997 - 00:00:00 CDT

Original text of this message

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