Re: Searching a value into the DB

From: Frank <franjoe_at_frisurf.no>
Date: Fri, 2 Mar 2001 19:31:41 +0100
Message-ID: <KKRn6.5276$t21.155510_at_news3.oke.nextra.no>


Hi!
[Quoted] I think this might be what you are looking for. It may create a horribly inefficient script because it will search through the same table
several times because several queries are created for each of the columns in [Quoted] one table :-(

Use data_length to filter some columns.
Someone else might help us(you) to remove the blank wide lines that this script creates:-)

Frank

set linesize 10000
set long 10000

spool c:/temp/script.sql

SELECT 'SELECT '''||table_name||'.'||column_name||''', COUNT(*) FROM '||owner||'.'||table_name||' WHERE '||column_name||'=''XXXXXX''; ' FROM sys.dba_tab_columns
WHERE owner='SCOTT'
AND data_type='VARCHAR2'
AND data_length=10;

spool off

spool c:/temp/findings.txt
_at_c:/temp/script.sql
spool off

Support <support_at_PLEASE_DO_NOT_SPAM_bilbao.com> wrote in message news:3a9fbe5a.199375086_at_news.sarenet.es...
> I know it is a simple script, but ...
>
> How could I find a value among every tables?
>
> The value is 'XXXXXX', but I do not know the name of the field nor the
> name of the table...
>
> Any easy script?
>
> ==============
> MIRELLO
Received on Fri Mar 02 2001 - 19:31:41 CET

Original text of this message