Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> problem with dynamic DDL using Dbms_SQL
I have been struggling with the creation of some dynamic routines for use
management in my 8.1.6 database. I coded up the logic DIRECTLY FROM THE
HELP PAGES. It fails too. Any ideas?
CREATE OR REPLACE PROCEDURE exec(STRING IN varchar2) AS
cursor_name INTEGER;
ret INTEGER;
BEGIN
cursor_name := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(cursor_name, string, DBMS_SQL.native);
ret := DBMS_SQL.EXECUTE(cursor_name);
DBMS_SQL.CLOSE_CURSOR(cursor_name);
END;
/
BEGIN exec('CREATE TABLE zpoo (col1 NUMBER)'); END;
/
*
ERROR at line 1:
ORA-01031: insufficient privileges ORA-06512: at "SYS.DBMS_SYS_SQL", line 782 ORA-06512: at "SYS.DBMS_SQL", line 32 ORA-06512: at "CEAG.EXEC", line 6 ORA-06512: at line 1Received on Fri Dec 06 2002 - 17:36:09 CST