[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Insufficient Privileges (execute immediate)

Posted on 2001-08-15
5
Medium Priority
?
1,239 Views
Last Modified: 2010-05-18
I created the following stored procedure for
dinamycally execute a DDL Sentence.

procedure ejecuta (sentence  in varchar2)
begin
execute immediate sentence;
end;

And it works well for DML Sentences, but
when I try to execute a DDL sentence like:

create table a (a number);

I receive an ORA-01031: Insufficient Priveleges

But the user that executes and owns the stored
procedure has DBA privileges.

If someone has any idea, please help me, I
will be grateful, if you do so ...

0
Comment
Question by:czoller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
ser6398 earned 40 total points
ID: 6389975
Does the user have CREATE ANY TABLE privilege?  Is it granted to that user through a ROLE, or specifically granted to that user?  If it is through a ROLE, you may have to specifically grant it to that USER.
0
 
LVL 5

Expert Comment

by:ser6398
ID: 6389982
i.e. Try the following:

GRANT CREATE ANY TABLE TO user_name;
0
 
LVL 2

Author Comment

by:czoller
ID: 6391112

Thank you so much, I didn't realize
that when I'm executing dynamic sql
privileges granted from roles are not valid
they have to be given directly ...

Thanks ...
0
 
LVL 5

Expert Comment

by:ser6398
ID: 6391206
It's not the dynamic sql, it is the Stored Procedure.  Stored Procedures are created with Owner's Rights.  If you give me the ability to execute a stored procedure in your schema, then I can execute it and it will run just like I have your privileges.  This allows you to give users the ability to access your tables only through the stored procedure (not give any table rights to people, but give them execute on the stored procedures you want, and they can access your tables through the stored procedures).  To make something work in a stored procedure, privileges normally have to be explicitly granted to the user and not granted through a role.
0
 
LVL 2

Author Comment

by:czoller
ID: 6393127
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question