Re: Cannot call function in query

From: N Prabhakar <n_prabhakar_at_post1.com>
Date: 1997/06/05
Message-ID: <5n5da8$t5v$1_at_newton.pacific.net.sg>#1/1


[Quoted] rowanm_at_intercoast.com.au (Rowan McCammon) writes: > PL/SQL: I've declared a function in a package that simply
> returns a constant.
>
> When I use this function in a SQL query I get an error
> message that tells me something like "Cannot perform
> query as database may be updated. Cannot guarantee non-
> update."
>
> If I then define a copy of this function outside the
> package (i.e.. simply a stored function) and call it from
> within a query, the query works fine.
>
> Can anyone explain this to me?
>
> Any help appreciated,
> Rowan McCammon.

Hi there

you need to use pragma restrict references to call a function from the sql query. Define the pragma at the package header

PRAGMA RESTRICT_REFERENCES (get_concat_description, WNDS, WNPS );

get_concat_description is the function name and you should define the above line in the package header

Hope it helps

Good Luck

N.Prabhakar Received on Thu Jun 05 1997 - 00:00:00 CEST

Original text of this message