extract column names of a table into Excel

I have to extract 22 table names and all their column names into a Excel spreadsheet.

thank you
LVL 1
vijadonAsked:
Who is Participating?
 
anand_2000vConnect With a Mentor Commented:
simpler
SQL> set colsep,
SQL> spool temp.csv
SQL> SELECT table_name||','||column_name||','|| data_type from user_tab_columns
SQL> spool off
0
 
cjjcliffordCommented:
Use an ODBC data source with the following SQL:

SELECT table_name, column_name, data_type FROM user_tab_columns

Or, do the following in SQLPlus:

SQL> set colsep,
SQL> spool temp.csv
SQL> SELECT table_name, column_name, data_type from user_tab_columns
SQL> spool off

Then load the created "temp.csv" file into Excel...

Cheers,
C
0
 
cjjcliffordCommented:
anand_2000v - how does that differ from mine????? Actually, how is it even simpler??? you've added ||','|| blocks which were not necessary with my answer ("set colsep," does this!)

vijadon (Author) - you should accept the first answer where there are duplicates.

Cheers,
C.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
anand_2000vCommented:
I agree that your answer was the first correct answer. you are absolutely right. I don't have a problem if the answer is awarded to you.
0
 
anand_2000vCommented:
I had missed out reading the colsep option when I replied.
0
 
cjjcliffordCommented:
anand_2000v, cheers (sorry if I came across a bit agressive, lots of "?" above... my new born baby is a little light on the sleeping and I'm a little short on sleep :-))

vijadon?
0
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.

All Courses

From novice to tech pro — start learning today.