Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Function does not guarantee... using DBMS_SQL package.
On writing a function using the DBMS_SQL package for dynamic SQL, the function is created (although the input is truncated to 1 character(?)), When I use the function with
SELECT f('a','b') FROM dual
I get an error;
ORA-06571: Function F does not guarantee not to update database
Although my function does not include any DDL statements. Any ideas why?
below is the code for the function:
create or replace 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
DBMS_SQL.PARSE (cursor_handle,
'select distinct ' || x ||
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
Chees,
Jim. Received on Mon Jul 24 2000 - 00:00:00 CDT