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: How to call Stored Functions in a Select Statement.

Re: How to call Stored Functions in a Select Statement.

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 1998/09/08
Message-ID: <35f85b79.39476528@netnews.worldnet.att.net>#1/1

On Sat, 05 Sep 1998 18:46:09 +0100, Aamer Akbar Janjua <aamer_at_janjua.demon.co.uk> wrote:

> I have a stored function which updates one table. I have to call it
>in a select statement.
> It gives me a error. Saying that the functions does not ensure
>updating database.

I don't believe that you can use a function in an SQL statement if it updates a table in the database. That's why you are getting the error. Further, even if your function does no updating, you must use a PRAGMA command to tell that to Oracle. This is done when the package creating the function is created. For example:

create package my_pack as

	function X returns number;
	pragma restrict_references (X,wnds);

end my_pack;

regards,

Jonathan Gennick Received on Tue Sep 08 1998 - 00:00:00 CDT

Original text of this message

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