Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Search for a string a database
You could also add in the column_name and table_name as strings so your
search will not only return the matching strings but where they came from
e.g.
select column_name, 'column_name', 'table_name' as grep_value
from table_name
union
Martin Doherty
Galen Boyer wrote:
>On 27 Nov 2002, cguyard_at_free.fr wrote:
>
>
>>I need to search for a string in a oracle database but i don't
>>know in which table this string is. I don't want to look all
>>tables... Is there someone that can help me....?
>>
>>
>
>Query the system tables for all string like datatypes, retrieving
>their table and column names. Slap the strings
>
> select column_name as grep_value
> from table_name
> union
>
>around them. Then, slap "create view oragrep as" on top of
>that. Replace the final union with ";". Now, execute that SQL.
>
>Then, execute the query,
>
>select * from oragrep where grep_value = 'string';
>
>
>
Received on Wed Nov 27 2002 - 13:26:05 CST
![]() |
![]() |