Hi,

I have a user A who owns several tables. Now, I want to grant select, update, delete, insert on all of user A's tables to user B. For this, I have written the following in grant.sql which I run after logging in as user A:

grant.sql:

declare
cursor c_tables is select table_name from user_tables;
v_tables c_tables%ROWTYPE;

begin
open c_tables;
loop
fetch c_tables into v_tables;
exit when c_tables%notfound;
grant select, insert, update, delete on v_tables.table_name to B;
end loop;
close c_tables;
end;
/

But this does not work. It says, "grant not allowed". How can I correct this, or is there a better way to do it ?

Thanks in advance for your help