Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL question
So you are going to basically search the entire database for the string
TOTO! Hope you don't do it often. This is one way to really generate a lot
of IO!
Look in the PL/SQL manual under dynamic SQL. Depending upon what version
of Oracle you are using you should find at least 1 way to do it.
Jim
"Thierry" <thierry.constant2_at_wanadoo.fr> wrote in message
news:3c1e5954$0$3191$626a54ce_at_news.free.fr...
> Hi,
>
> I try to find a string TOTO in any table belonging to a user JOHN
> I write the following in PL/SQL:
>
>
> ===============================================================
> declare
> cursor c1 is
> select table_name,column_name from dba_tab_columns where
> owner='JOHN' and data_type like '%CHAR%';
> nom_table varchar2(30) ;
> nom_col varchar2(30) ;
> begin
> open c1;
> loop
> fetch c1 into nom_table,nom_col;
> exit when c1%notfound;
> select * from nom_table where nom_col like '%TOTO%';
>
> >>>there is something wrong using the variables nom_table and nom_col
> >>>but I don't know what , any help ????
>
> end loop;
> close c1;
> end;
> /
> ====================================================================
>
>
Received on Mon Dec 17 2001 - 21:57:05 CST