ckaley
asked on
sqlplus not showing column names
I have a query that returns all the columns from my DB base on the provided criteria. The problem is that there are 81 columns and I need to see which values correspond to each column name.
The query is as folows:
set colsep ,
set heading on
set feedback off
set pagesize 0
set linesize 3000
set trimspool on
spool my_file.csv
select * from doctaba where A33 in (07323910933,07323910934)
I see all the data in the sqlplus output and the csv file, but do not see what column is associated with each value. My DBA says the only way to get the column names is by specifying each column individually in the select. Is this correct? I really don't want to specify 81 column names.
Thanks
The query is as folows:
set colsep ,
set heading on
set feedback off
set pagesize 0
set linesize 3000
set trimspool on
spool my_file.csv
select * from doctaba where A33 in (07323910933,07323910934)
I see all the data in the sqlplus output and the csv file, but do not see what column is associated with each value. My DBA says the only way to get the column names is by specifying each column individually in the select. Is this correct? I really don't want to specify 81 column names.
Thanks
ASKER
Is there any way to get all the columns to show up on the same line? The output looks like this?
F_DOCNUMBER,F_DOCCLASSNUMB ER,F_ENTRY DATE,F_LAS TACCESS,F, F_ARCHIVED ATE,F_PURG EDATE,F_DE LETEDATE,F ,F,F
A40
A60
A72
A85
This is carrying over to the csv file. Unfortunately the created set up all these columns to be VARCHAR2(239) even for fileds that will never see more than 11 characters.
F_DOCNUMBER,F_DOCCLASSNUMB
A40
A60
A72
A85
This is carrying over to the csv file. Unfortunately the created set up all these columns to be VARCHAR2(239) even for fileds that will never see more than 11 characters.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much for the fast response. Do you want to come be our DBA? :) My DBA had no idea about how to do any of this. Again thank you for saving me from a big headache.
Glad I could help, for more information about using sql*plus commands you can look here...
http://www.oracle.com/pls/db102/to_pdf?pathname=server.102%2Fb14357.pdf&remark=portal+%28Application+development%29
and thanks for the offer, but I'm happy where I am
http://www.oracle.com/pls/db102/to_pdf?pathname=server.102%2Fb14357.pdf&remark=portal+%28Application+development%29
and thanks for the offer, but I'm happy where I am
set pagesize 0
doing that turns off headings, even if you have "set heading on"