Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Quering table names containing a value in any column

715303Jan 28 2010 — edited Jan 29 2010
I searched a bit around this forum and found a solution for how to query the list of all tables

select table_name from user_tables;

However, I do not know how to do this -

I want to find the list of all table names where any of the fields in these tables should have the value containing a number in it.

Say for example I have a database containing many tables Students, Teachers, Principals and many other such 100+ tables. I want to find the list of all tables names which contain the word "ohn" in any of their fields. The string "ohn" MAY be in Employees table under First Name field as John and in Teachers under Nick Name field as Johnny, etc.

So, I do not know what are the columns/field names. I only know that the value of any of these columns will contain the string "ohn" (like '%ohn%'). Now, how do I write a query for this which will give me the table names?

Please assist!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2010
Added on Jan 28 2010
8 comments
4,423 views