PL/SQL: execute immediate

From: <gunyo_at_ludens.elte.hu>
Date: 16 May 2003 11:02:48 +0200
Message-ID: <J9jYV9n68MuA_at_ludens>


I'm making a PL/SQL package in which there is a procedure, let's call it now X. in X I try to create a table:

procedure X is
begin
...

execute immediate 'create table t1 (i int)';
...

end X;

The procedure compiles, but when calling it, I get an error message: 'Insufficient privileges'.
However, this way I can create tables in a PL/SQL block: begin execute immediate 'create table t1 (i int)' end; /
This works, but I need it to work in the procedure. Any ideas, what causes this? If it is a rule you can't create tables from inside of procedures, is there any workarounds? I work under Oracle 9i, UNIX.

Thx Received on Fri May 16 2003 - 11:02:48 CEST

Original text of this message