Tuesday, July 16, 2013

List all the table information with specified column_name

Say, we have a column_name and we want to find out which table it belongs to, or to know all the tables and views have this column. Here is my way

SELECT * FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME = 'ID'

OR

SELECT * FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME LIKE '%ID%'

Always use upper case for column_name value. It will list all the tables info along with the owner schema.

No comments:

Post a Comment