Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select into a command...
On Tue, 26 Jul 2005 23:46:21 +0200, "Andrea" <no_at_tin.it> wrote:
>Hi,
>
>i need make a grant on all table of a user (oracle 8.1.7) :
>
>grant all on myuser.table1 to public;
>grant all on myuser.table2 to public;
>grant all on myuser.table3 to public;
>ecc...
>
>and i would like to know if possible run a select command during a grant
>(select table_name from all_tables where owner = 'MYUSER')??
>otherwise i have to run a select with a spooler but i don't know what i do
>after this step..
>
>thanks very much!!
>
>bye
>
The code above is likely not going to work unless myuser has granted
you all privileges with grant option.
The following would work connected as myuser
begin
for i in (select table_name from user_tables) loop
execute immediate 'grant all on '||i.table_name||' to public';
end loop;
end;
/
As the myuser schema is fully unprotected now, I would fire you for this.
-- Sybrand Bakker, Senior Oracle DBAReceived on Tue Jul 26 2005 - 16:55:14 CDT
![]() |
![]() |