Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> problem with dynamic DDL using Dbms_SQL

problem with dynamic DDL using Dbms_SQL

From: PGY <pgy_at_magma.ca>
Date: Fri, 06 Dec 2002 23:36:09 GMT
Message-ID: <JvaI9.1925$yq.59487@news>


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 1
Received on Fri Dec 06 2002 - 17:36:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US