Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Oracle 10g Granted privileges and dynamic sql

Posted on 2007-11-15
4
Medium Priority
?
2,873 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 500 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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…
Suggested Courses

972 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