Hi Raynard7,
I tried running this query as is replacing only the "YourTableName", but it did not work. Did I miss a step?
Main Topics
Browse All TopicsHello Experts,
I am trying to export only the column names within a table to an excel or .txt file. Or just being able to display the column names via a SQL query and then copying them to a file. Can someone suggest the best way that this can possibly be done?
Thanks,
Studious01
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If you are using TOAD:
From the sql editor window you should be able to run this query to get the column names:
select column_name
from user_tab_cols
where table_name = 'TAB1'
If you are looking at the schema browser you should make a fw setting changes to see these views.
In schema browser click
synonyms tab> click filter > Check synonym type Public> Check the radio button "for Objects owned by" to "Any Schema"> click OK
NOw you will be able to see the view: user_tab_cols
Business Accounts
Answer for Membership
by: Raynard7Posted on 2007-02-25 at 14:28:24ID: 18606376
Hi - if your table's name is "YourTableName" if you run the query
SELECT
T.TABLE_NAME,
T.COLUMN_NAME
FROM
SYS.ALL_TAB_COLS T
WHERE
T.TABLE_NAME = 'YourTableName'
Note you may also need to specify the schema as appropriate,