How to find table name when knowing column name and column value in Oracle
A tester in my project asked me today for a little help: how to find a list of tables that has column name
A with value
B. So I wrote a short script and sent him. I thought I would share it here too, in case if might be useful to someone.
Usually cases like this, you will query from
all_tab_cols for list of tables that has a column with that name and find out.
The query below will do exactly that but with the loop added to make searching easier. Make sure you have DBMS output enabled.
Found 0 record(s) in TABLE_NAME Found 1 record(s) in TABLE_NAME1 Found 0 record(s) in TABLE_NAME2