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

Home -> Community -> Usenet -> c.d.o.misc -> DBMS_SQL

DBMS_SQL

From: miguel <jmiguel_at_cet.pt>
Date: 23 Oct 1998 11:40:42 GMT
Message-ID: <01bdfe7a$81f193c0$0a0a2c0a@jmiguel.intra.cet.pt>


Can someone help me?
Oracle 7.3.3 on NT 4.0

When user SCOTT execute:
DECLARE
 CURSOR_NAME INTEGER;
 RET INTEGER;
BEGIN
 CURSOR_NAME := DBMS_SQL.OPEN_CURSOR;
 DBMS_SQL.PARSE(CURSOR_NAME,'CREATE TABLE BB(A NUMBER(3))',DBMS_SQL.V7);  RET := DBMS_SQL.EXECUTE(CURSOR_NAME);
 DBMS_SQL.CLOSE_CURSOR(CURSOR_NAME);
END;
/

everything is OK
but when use a procedure like:
CREATE OR REPLACE PROCEDURE TEST(STRING IN VARCHAR2) AS  CURSOR_NAME INTEGER;
 RET INTEGER;
BEGIN
 CURSOR_NAME := DBMS_SQL.OPEN_CURSOR;
 DBMS_SQL.PARSE(CURSOR_NAME,STRING,DBMS_SQL.V7);  RET := DBMS_SQL.EXECUTE(CURSOR_NAME);
 DBMS_SQL.CLOSE_CURSOR(CURSOR_NAME);
END;
/

and try to execute:
EXECUTE TESTE ('CREATE TABLE CC(A NUMBER(2))'); an error ocurr:
ERROR at line 1:

ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SYS_SQL", line 239
ORA-06512: at "SYS.DBMS_SQL", line 32
ORA-06512: at "SCOTT.TEST", line 6
ORA-06512: at line 1

Why????

Thnks
Miguel Received on Fri Oct 23 1998 - 06:40:42 CDT

Original text of this message

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