From: Lando <MarkL@quebim.com>
Subject: Re: ORA-06571 HELP!!! HELP!!! HELP!!!
Date: 1997/10/10
Message-ID: <343E6868.924CE687@quebim.com>#1/1
References: <343EB853.DD7@arrakis.es>
X-Priority: 3 (Normal)
X-Complaints-To: usenet@pppl.gov
X-Trace: tom.pppl.gov 876505181 18677 (None) 198.140.134.42
Organization: Princeton Plasma Physics Laboratory
Reply-To: MarkL@quebim.com
Newsgroups: comp.databases.oracle.server



Basically, you need to tell the compiler that this packaged  function is
not going to do a update
to the database. To do this your function declaration needs to have a
Pragma Restrict_References statement. For example:

Create or  replace package TestPkg  as

   Function TestFnct  (str  in  varchar) return boolean;
      Pragma restrict_references(IsDigits, RNDS,RNPS,WNDS,WNPS);
   End TestFnct;
.
.
.

where: RNDS = Reads no database state - does not modify db table
           RNPS = Reads no package state   - does not change pkg
variables
           WNDS = Writes no database state - does not query db tables
           WNPS = Writes no package state   - does not reference pkg
variables


I believe this is discussed in the Application Developers Guide.


Ismael Perez wrote:

> Ismael Perez wrote:
>
> Hi All,
>
>         I have a problem with a Function. I´m using a function that
> INSERT
> records in a Table.
> The function is in a Package, the function Return a NUMBER. When I
> called this function from
> an SQL expression, such as:
>         SELECT <function-name> FROM DUAL;
>
> Oracle return this Error:
>         ORA-06571 Function <function-name> does not guarantee not to
> Update
> Database
>
> How can I resolve this Error...
>
>         Thanks
>
>  e-mail: perez32@arrakis.es
>          ismael@eitb.com





