user4386993
user4386993

Reputation: 1

How to find the name of a table based upon a column name and then access said table

I have a column name "CustomerIDClass" and I need to find the table it's associated with within an entire Oracle database.

I've run this to determine the owner and name of the table where this column name appears:

select * from DBA_TAB_COLUMNS 
where COLUMN_NAME LIKE '%CustomerIDClass%';

and I'm getting this response: I don't have enough reputation to post the image, so here's the link: http://i.imgur.com/a7rcKoA.png

I have no idea how to access this (BIN$Csew==) table. When I try to use it as a table name I get errors or messages saying that no rows were returned.

My main goal here is to write a simple statement that lets me search the database for the "CustomerIDClass" and view the table that contains this column name.

Upvotes: 0

Views: 154

Answers (2)

Jayadeep Jayaraman
Jayadeep Jayaraman

Reputation: 2825

Do note that in oracle the column names are stored in capital but you are using mixed case in your like statement therefore the select clause will not return any result

Try the below select * from DBA_TAB_COLUMNS where COLUMN_NAME LIKE '%CUSTOMERIDCLASS%';

Upvotes: 0

Kirill Leontev
Kirill Leontev

Reputation: 10931

This table is in the recycle bin. You have to issue FLASHBACK TABLE "Customer1"."BIN$Csew==$0" TO BEFORE DROP command, given you have the appropriate privileges.

Doc: http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9012.htm

Upvotes: 1

Related Questions