search colum names in tables

Is there an efficient way to search all tables with column name - eg like ROR_MTD.
I would like the output to show the table name - preferably in what schema - and the column name.

Schema        Table          Colum_Name
TEST1           TABLE1      A_ROR_MTD
TEST2           TABLE 2     RORMTD
PHIL SawyerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
select owner,table_name,column_name
from dba_tab_columns
where column_name like '%ROR%MTD%'
Steve WalesSenior Database AdministratorCommented:
You can do:

select owner, table_name, column_name
from dba_tab_columns
where column_name like '%YOUR_MATCH_PATTERN%'

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PHIL SawyerAuthor Commented:
Thanks guys
slightwv (䄆 Netminder) Commented:
Should also add that this shouldn't be necessary but some, not familiar with Oracle, does some 'bad' things from time to time and creates objects with forced case (lower case characters).

Again, this isn't the 'default' for Oracle and is a pretty BAD idea but I've seen some folks do it.

If this is a concern or possibility for you:
where upper(column_name) like '%ROR%MTD%'
slightwv (䄆 Netminder) Commented:
Something to add to your bag-o-tricks to help with this in the future.

Oracle is very good about naming the views.

I created a script using the query below and named it find_view.sql.

Whenever I'm not sure of the 'exact' view I want, I run the script and give it the 'item' I think I'm looking for.

in this example, you were after a COLUMN names.

Run the select/script and type in COLUMN when prompted.

It will return all views that have that term in them.  You can then scan the list pretty quick and look up the views in the docs that you think might be what you need.

dba_tab_columns is in that list.  Given the name of the view, one might think that this might contain table columns?  A quick search of the docs would confirm it.

select view_name 
from dba_views 
where view_name like upper('%&view_to_find%') order by 1

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.