Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Retrieving table name
On Tue, 18 Jun 2002, noemie_freyburger-buttet_at_epsilon_ch wrote:
> Hello
>
> I would like to retrieve all tables containing a column named
> "status". How can I do that ?
I call this script "grep_columns". Put it in your SQLPATH and then type "@grep_columns" at the sqlplus prompt.
accept GrepString char PROMPT 'Grep String: '
set head off
set head on
column type format A5 wrap
column table_name format A30 wrap
column COLUMN_NAME format A25 wrap
column DATA_TYPE format A10 wrap
select t2.object_type TYPE , t1.table_name, t1.column_name, t1.data_type
from user_tab_columns t1,
user_objects t2
where t1.table_name = t2.OBJECT_NAME
AND t1.COLUMN_NAME like upper('%&GrepString%')
order by t2.object_type, t1.table_name
/
-- Galen BoyerReceived on Tue Jun 18 2002 - 11:17:12 CDT