Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Function does not guarantee... using DBMS_SQL package.
On Mon, 24 Jul 2000 14:44:35 +0200, "Frank van Bortel" <f.van.bortel_at_vnl.nl> wrote:
>Somewhere along the line, purity is set for (one of the elements of)
>packages.
>You'll have to add pragma's, i.e:
>pragma restrict_references(YourFunction, WNDS, WNPS);
>in the specification of the package.
>There are 4 pragma's possible:
>WNDS: Write No Database State
>WNPS: Write No Package State
>RNDS: Read No Database State
>RNPS: Read No Package State
Thankyou for the helpful reply to my last question. However, on creating the following package and function (with pragma) the error below is given;
CREATE OR REPLACE PACKAGE jim AS
FUNCTION f(x in varchar2, y in varchar2)
create or replace package body jim as
function f(x in varchar2,
y in varchar2)
return varchar2 is cursor_handle integer := DBMS_SQL.OPEN_CURSOR; dbms_sql_feedback integer; return_value varchar2(100) :=NULL;begin
'select distinct ' || x || ' from ' || y || ' where type = ''CRE_DEL''',DBMS_SQL.NATIVE);DBMS_SQL.DEFINE_COLUMN (cursor_handle,1,x,100); dbms_sql_feedback := DBMS_SQL.EXECUTE (cursor_handle); dbms_sql_feedback := DBMS_SQL.FETCH_ROWS (cursor_handle); if dbms_sql_feedback > 0
On compiling the function f the error;
PLS-00452: Subprogram 'F' violates its associated pragma
is given. Why?
Jim. Received on Mon Jul 24 2000 - 00:00:00 CDT