Tuesday, August 14, 2012

Find the table name of given column name in Oracle

If someone asks you  to find the table name which contains given column name in oracle platform, you need to query against the ALL_TAB_COLUMNS.
From Oracle documentation, ALL_TAB_COLUMNS  describes the column of the tables, views and cluster accessible to the current user.
You can query like this to find the table name which contains given column name:

SELECT table_name FROM all_tab_columns
WHERE column_name LIKE '%your_search_column_name%'