Re: ORA 6571 Function doesn't guarantee NOT to update database

From: Bruce Douglas <bruce.douglas_at_bridge.bst.bls.com>
Date: 1996/10/23
Message-ID: <326E792B.2654_at_bridge.bst.bls.com>#1/1


James B. Corbin wrote:
>
> I have a function in a package, say APKG.AFUNC(), that takes
> a parameter, does some processing, and returns a VARCHAR2.
> This function works fine in a PL/SQL cursor. However, when I
> call this function like this (a trivial example) at the SQL*Plus
> prompt:
>
> SELECT Apkg.AFunc('abcd') FROM dual;
>
> Oracle returns the ORA-06571 error. The errors text (from the
> "oerr" command) says:
>
> 06571, 00000, "Function %s does not guarantee not to update database"

Jim,

The pragma is this:
PRAGMA RESTRICT_REFERENCES (
        function_name,option,[option]);

where option is one of these constants:

WNDS -- no database writes
WNPS -- does not change the state of packaged variables
RNDS -- no database query
RNPS -- no reference to packages variables 

The pragma follows the function declaration in the package specification.

This is documented in the PL/SQL Release 2.1 and Oracle Precompilers Release 1.6 addendum, pages 2-2 through 2-8.

Hope this helps...



Bruce Douglas -- bruce.douglas_at_bridge.bellsouth.com BellSouth Telecommunications
Received on Wed Oct 23 1996 - 00:00:00 CEST

Original text of this message