oracle sql query

hi guys,

Can we know that , a particular column is exist in which table of database.
E.g I am working in a database 'ABC' which have 100 tables, now I want to know the name of tables which have a column 'ENO'.
Please rep soon.
LVL 1
ajay_erdciAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

azureshowCommented:
hi, you can use the sql as following to find the table which the column_name ='ENO'[select table_name from cols where column_name='ENO'].Hope you can make it soon.
/
0
ajay_erdciAuthor Commented:
Dear Azureshow,

I very sorry to say that there is a change in the question, I was trying to change it on the same time you make the reply.
That is not the table , basically its a public synonym which is assiend to each user.
Please consider the change and make the reply.

Sorry again

AJAY
0
mona1974Commented:
COLS is a snonym for USER_TAB_COLUMNS. Try to select from ALL_TAB_COLUMNS.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ajay_erdciAuthor Commented:
Dear Mona1974,

My user do't have the access to draw the data from tables, because he is no where conseren to table.
Give me the way by which we can know the synonym names in which that column has been used.

ajay
0
oraelbisCommented:
As say mona1974 try select from ALL_TAB_COLUMNS such as:

select C.TABLE_NAME
  from ALL_TAB_COLUMNS C
 where C.COLUMN_NAME='ENO' and C.OWNER='ABC'
0
oraelbisCommented:
You can grant this table directly to user or role.
Or such as for me, create simple view such as

create or replace view V_ALL_TAB_COLUMNS as
select C.TABLE_NAME, C.COLUMN_NAME, C.OWNER
 from SYS.ALL_TAB_COLUMNS C

and then grant this view to role or user such as:

GRANT SELECT ON V_ALL_TAB_COLUMNS TO FIN_ROLE;

granting privileges via ROLE are more simple, for many users.
0
azureshowCommented:
SQL: select synonym_name from user_synonyms A,cols B
where A.table_name=B.table_name and B.column_name='ENO' and B.owner='ABC'

Sorry, I have been busy these days, and hope that you have solved it already. If not wish the SQL above will help you clear your question. PS:Because I can not understand your question well, I can only give you the answer from the other comments.
0
walterecookCommented:
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in approximately 4 days.  I would appreciate any comments by the experts that would help me in making a recommendation.

It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help.jsp#hs5

walterecook
EE Cleanup Volunteer
0
walterecookCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ - no points refunded

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

walterecook
EE Cleanup Volunteer
0
amp072397Commented:
PAQed - no points refunded (of 150)

amp
Community Support Cleanup Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.