non owner likes to truncate table in oracle
Without grant Drop any table, I used the following script
1. create a stored procedure
2. grant execute on that procedure to that user
create or replace procedure userx.truncateTable( p_tname in varchar2 )
as
begin
execute immediate 'truncate table ' || p_tname; --DDL, implicit commit
end;
CREATE TABLE userx.TEMP11
(x NUMBER(2,0),
x2 VARCHAR2(20 CHAR),
x3 VARCHAR2(20 CHAR),
x4 VARCHAR2(20 CHAR),
x5 VARCHAR2(20 CHAR)
);
grant execute on userx.truncateTable to usery;
have usery run
execute userx.truncateTable ('Temp11');
Comments
Post a Comment