Wednesday, May 27, 2009

Grant Select on all Tables Owned By Specific User

BEGIN
FOR R IN (SELECT owner, table_name FROM all_tables WHERE owner='OwerName') LOOP
EXECUTE IMMEDIATE 'grant select on '||R.owner||'.'||R.table_name||' to UserName';
END LOOP;
END;

No comments:

Post a Comment