Solved

Oracle 10g Granted privileges and dynamic sql

Posted on 2007-11-15
4
2,838 Views
Last Modified: 2012-06-22
Oracle 10g I have a stored procedure that I invoke from a sql*plus session connected as schema ca50633. It executes the following command which fails with an error message about insufficient privileges.

COMMAND := 'TRUNCATE TABLE RT_TEST.STATIC_DATA';      
EXECUTE IMMEDIATE COMMAND;

I have granted ca50633 all privileges on the rt_test.static_data table from the rt_test schema and can truncate the table interactively from sql*plus.

What am I missing?
0
Comment
Question by:rmtye
  • 2
4 Comments
 
LVL 1

Expert Comment

by:bobbymanocha
ID: 20292113
PL/SQL doesn't recognize privileges granted through roles.  The privilege needs to be granted directly.
 
grant drop any table to ca50633;
0
 
LVL 18

Expert Comment

by:Jinesh Kamdar
ID: 20292130
GRANT TRUNCATE ON rt_test.static_data TO ca50633;
0
 

Author Comment

by:rmtye
ID: 20292316
I granted all on rt_test.static_data to ca50633; but, it didn't help.

Grant truncate returned an error message
0
 
LVL 1

Accepted Solution

by:
bobbymanocha earned 125 total points
ID: 20292361
grant all grants object privileges.    You need a system privilege here, and 'grant drop any table to ca50633' will do that for you.

Alternatively, compile the stored procedure in the rt_test schema and grant execute on the procedure to ca50633.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
File generation using utl_file 4 53
Read only access to a Procedure in oracle? 4 64
Oracle - SQL Parse String 5 33
Help on model clause 5 27
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now