Solved

Oracle 10g Granted privileges and dynamic sql

Posted on 2007-11-15
4
2,845 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
[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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

735 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