From: tkyte@us.oracle.com (Thomas Kyte)
Subject: Re: ORA-06571  HELP!! HELP!! HELP!! HELP!!
Date: 1997/10/10
Message-ID: <343e644f.14363313@newshost>#1/1
References: <343EB828.7C44@arrakis.es>
Organization: Oracle Government
Reply-To: tkyte@us.oracle.com
Newsgroups: comp.databases.oracle.misc



On Fri, 10 Oct 1997 16:20:09 -0700, Ismael Perez <perez32@arrakis.es> 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

You cannot.  The basic rule for functions that are to be called from SQL
statements is that those functions simply may not modify the database.

Any function that does an insert/update/delete/commit or calls dbms_sql to do
any sort of dynamic sql simply cannot be called from a sql statement.

What is it you are trying to do?  Perhaps we can suggest a workaround.


Thomas Kyte
tkyte@us.oracle.com
Oracle Government
Bethesda MD

http://govt.us.oracle.com/    -- downloadable utilities

----------------------------------------------------------------------------
Opinions are mine and do not necessarily reflect those of Oracle Corporation


