Find table from querying column name in oracle SQL developer

41,796

Solution 1

The query that worked was

SELECT * FROM ALL_TAB_COLUMNS 
WHERE COLUMN_NAME LIKE '%TASK%' 
AND owner = 'database_name';

It was the 'owner' part I did not previously know about. Everyone who answered certainly opened avenues for further Googling.

Cheers

Solution 2

The IDE itself has a feature for this, View > Find DB Obect

here's a 20 second video showing it, in action

Solution 3

If you need to find table name then 'juergen d' answered your question. If you nee to find column names then use user_tab_columns/all_tab_columns to select column names where table='YOUR_TABLE' - must be in upper case as well as column names.

Share:
41,796
SunnyNewb
Author by

SunnyNewb

Updated on July 09, 2022

Comments

  • SunnyNewb
    SunnyNewb almost 2 years

    I want to query a database for a column name to find the table without knowing the table name (there are a huge number of tables)

    I am working with a huge database at the moment and trying to find where, based on CFML code and the URL of the problematic page, a website is retrieving information from. I am new to ColdFusion however I can see that the URL contains a few ID references with column names. Some I have been able to find easily and others, I have no idea as the column names are quite vague e.g. 'NTASKID'.

    My plan is to try to query the database using the column name but Google has presented me queries which require knowing the table name which I do not have. I guess those examples may have been more useful for denormalised tables(?).

    If someone knows such a query it would be great. Additionally, could someone please comment on whether I am going down the right avenue of investigation here?