Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

PL/SQL Question (execute immediate)

gunyogunyo Member Posts: 6
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
Sign In or Register to comment.