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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL question

Re: PL/SQL question

From: Ron Reidy <rereidy_at_indra.com>
Date: Mon, 17 Dec 2001 14:07:23 -0700
Message-ID: <3C1E5E8B.C5B00CB@indra.com>


Thierry wrote:
>
> 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;
> /
> ====================================================================
Look up 'Native Dynamic SQL' in the PL/SQL docs.

-- 
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
Received on Mon Dec 17 2001 - 15:07:23 CST

Original text of this message

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