RE: dynamic SQL with DBMS_SQL

From: SHO <hos000_at_uleth.ca>
Date: 1997/07/12
Message-ID: <33C831C9.83EC1EBC_at_uleth.ca>#1/1


Hi ,
[Quoted] [Quoted] I am attempting to use DBMS_SQL to dynamically create tables or views. [Quoted] These are my sample codes:

PROCEDURE DYNSQL AS
  cur integer;
  rc integer;
BEGIN
  cur := DBMS_SQL.OPEN_CURSOR;
[Quoted]   DBMS_SQL.PARSE(cur, 'CREATE TABLE X (Y DATE)', DBMS_SQL.V7);   rc := DBMS_SQL.EXECUTE(cur);
  DBMS_SQL.CLOSE_CURSOR(cur);
END; [Quoted] It compiles fine but when I try to run it, I get the following errors:

[Quoted] ERROR at line 1:

[Quoted] ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SYS_SQL", line 239
ORA-06512: at "SYS.DBMS_SQL", line 25
ORA-06512: at "HUM_WWW00.DYNSQL", line 6
ORA-06512: at line 4

[Quoted] I have usd to select and update using DBMS_SQL dynamically without any problem
I am pretty sure I have privileges create table and views. Would I need higher privs to dynamically create tables or views?

[Quoted] Thanks in advance for your help

SH Received on Sat Jul 12 1997 - 00:00:00 CEST

Original text of this message