Re: Using stored function in a SELECT

From: Scott Urman <surman_at_wwsun10.us.oracle.com>
Date: 17 Dec 1994 01:33:46 GMT
Message-ID: <3ctf5q$9m5_at_dcsun4.us.oracle.com>


In article <445362.94Dec16120401_at_aisserver1.llnl.gov>, 445362_at_aisserver1.llnl.gov (Grant Johnson) writes:
|>
|> I'm trying to use a stored function from a SELECT statement, a new feature
|> in 7.1.3, am getting the following error:
|>
|> ERROR at line 1:
|> ORA-06571: Function VAL_PER_SINGLE does not guarantee not to update database
|>
|> Which is described as:
|>
|> 06571, 00000, "Function %s does not guarantee not to update database"
|> // *Cause: A plsql function that does not have a pragma asserting that it
|> // does not write any database state is referenced in a sql statement.
|> // Such functions cannot be used in sql statements.
|> // *Action: Recreate the function and/or the functions it calls with the pragma
|>
|> Now the question is, what is the syntax of the pragma to let the db know
|> this function is 'safe' ?
|>
|> I've looked through all the manuals I can get a hold of and can find no
|> reference to this new pragma.
|>
|> Thanks in advance.
|>
|> Grant Johnson Internet: grantj_at_llnl.gov
|> Lawrence Livermore National Lab PacBell Net: (510) 423-0406

pragma restrict_references(<function_name>, wnds [,wnps] [,rnds] [,rnps]);

The relevant manual is the 'PL/SQL Release 2.1 and Oracle Precompilers Release 1.6 Addendum', part number A11828-3. Received on Sat Dec 17 1994 - 02:33:46 CET

Original text of this message