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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Functions that Insert data and return value

Re: Functions that Insert data and return value

From: mgumbs <mgumbsNOmgSPAM_at_hotmail.com.invalid>
Date: Wed, 08 Dec 1999 09:28:32 -0800
Message-ID: <0b798e26.bbf39b36@usw-ex0102-010.remarq.com>


If you run the function from SQLplus like...

SQL> declare
SQL>  v_retval numner;
SQL> begin
SQL>  v_retval := Process(1);
SQL> End'

That should be ok. However, if you were running it from within a SQL statement, you have to tell oracle about what the function is going to do, ie the functions Purity.

If any part of your functions updates the database, inserts into the database, writes to packaged variables etc you need to declare it in your procedure or package spec.

If you look at documentation for PRAGMAS and in particular PRAGMA RESTRICT REFERENCES, it should tell you all you need to know about running functions within SQL statements.

The different pragmas are WNDS, WNPS, RNDS, RDPS (Write No Database State, Write No Package Stare, Read no.....)

Mark.

Received on Wed Dec 08 1999 - 11:28:32 CST

Original text of this message

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