Database & SQL

Moderators: None (Apply to moderate this forum)
Number of threads: 1174
Number of posts: 2221

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
PL/SQL question: execute immediate Posted by gunyo on 16 May 2003 at 1:58 AM
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

Thread Tree
gunyo PL/SQL question: execute immediate on 16 May 2003 at 1:58 AM
infidel Re: PL/SQL question: execute immediate on 19 May 2003 at 8:09 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.