Hi guys
I have one schema (lets say XYZ) and there are some tables in it. I have created another user TESTING in the database.
I wrote a procedure GRANT_SELECT in the SYSTEM schema (as the procedure, by default will execute with the owner's rights...right ?) through which TESTING user can get the SELECT privilege on objects of XYZ. Then i granted execute on procedure to TESTING user.
create or replace procedure grant_select(p_object in varchar2,
p_owner in varchar2) is
v_String varchar2(500);
begin
v_String := 'grant select on ' || p_owner || '.' || p_object ||
' to testing';
execute immediate v_string;
--dbms_output.put_line(v_string);
end grant_select;
Now when i am trying to execute this from TESTING user, it gives:
ORA-01031: insufficient privileges
ORA-06512: at "SYSTEM.GRANT_SELECT", line 7
ORA-06512: at line 1
Is it not executing with SYSTEM rights ? or i am mis-interpreting the things ?
Thanks
Amardeep Sidhu