How to extract the table name by using its column name?
Is that possible, if yes, can anyone tell me how
[B]Question asked by visitor Debasis Das[/b]
Printable View
How to extract the table name by using its column name?
Is that possible, if yes, can anyone tell me how
[B]Question asked by visitor Debasis Das[/b]
Hi,
It is not possible to get the table name by taking the reference of a column name.
In oracle it is possible if you have defined any constraint on the column :)
Hope you have got me...yeah you can use user_constraints to get the table name...
PLEASE USE THIS
[code]select table_name from DBA_TAB_COLUMNS where owner ='OWNER_NAME' and column_name= 'COLUMN_NAME'[/code]
NOTE:--But it will display all the tables having a common / same column name.
hi u can use these two tables also in yr schema
user_tab_columns,user_tab_cols
Yes you can also do that.
But if u select from DBA_TAB_COLUMNS table u can specify of any user schema dynamically.
just give a name to constraint and try this it will work
select table_name from user_constraints
where constraint_name='<constraintname>';
select distinct table_name from user_tab_columns where column_name= 'value';