Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

grant truncate

happy10319Jan 30 2013 — edited Feb 1 2013
Hi,
on 11G R2,
We want to grant truncate any table to a user.
How ?
We should create the following procedure ?
1. Create the procedure to truncate the table.

create or replace procedure truncate_table (
table_name varchar2,
storage_type varchar2)
as
crsor integer;
rval integer;
begin
dbms_output.put_line('Truncating Table : '|| table_name ||
' Storage : '|| storage_type);
crsor := dbms_sql.open_cursor;
dbms_sql.parse(crsor, 'truncate table '|| table_name ||
' '|| storage_type ,dbms_sql.v7);
rval := dbms_sql.execute(crsor);
dbms_sql.close_cursor(crsor);
end;
/
grant execute on <procedure_name> to <user>
Is it for only one table ? If yes how to do that for all tables ? Or the tables of a schema ?

Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2013
Added on Jan 30 2013
6 comments
2,173 views