Skip to main content

Hi!

As I said in the title, I need to know which table contains a specific column. Would the following query work for that? What should I put in the from-clause?

 

SELECT      COLUMN_NAME AS 'ColumnName', TABLE_NAME AS  'TableName'

FROM        

WHERE       COLUMN_NAME LIKE '%storage_instructions%'

ORDER BY    TableName

            ,ColumnName;

You could try to use the view DICTIONARY_SYS_TAB_COLUMNS. You won’t find a column called “storage_instructions”, unless you use UPPER(). 


To find all tables with a particular column if you know the column name accurately:

select owner, table_name from all_tab_columns where upper(column_name) = upper('<name_of_the_column>');

 To find all tables with a particular column if you don't know the accurate column:

select owner,table_name from all_tab_columns where upper(column_name) like upper('%keyword%');

Thank you, I found the right table 👍


Reply