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
execute immediate 'create table t1 (i int)';
The procedure compiles, but when calling it, I get an error message:
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.