Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: select into a command...

Re: select into a command...

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 26 Jul 2005 23:55:14 +0200
Message-ID: <m5cde1heu4ug33t7oetshr94r8gec49e17@4ax.com>


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 DBA
Received on Tue Jul 26 2005 - 16:55:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US