Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQLPLUS: creating a text file with column header and tabel rows?

SQLPLUS: creating a text file with column header and tabel rows?

From: Caja <carsten.jacobs_at_web.de>
Date: 9 Aug 2005 08:02:32 -0700
Message-ID: <1123598697.730400.167020@f14g2000cwb.googlegroups.com>


Hello,

I'm going crazy trying to create a simple thing. What I want is a textfile with the column names of a specific table in the first row and the content of the table in the other rows.

The methods I already tried are something like

spool table_content.txt
set colsep |
set headsep |
set wrap on
set pagesize 80000
set trims on
set feedback off
set underline off
select * from mytable;
exit

I can get either a file where the headline (column names) is multible in the file or not at all. I couldn't get just once in the first row. Furthermore has the output linefeeds in between 1 table row. But I want one table row in one file row.

Finally it should be a file which is separated by a delimiter and can be imported into a spreadsheet. It should also be table independent because the queried table could be a parameter in an unix shellscript which is wrapped around the whole thing.

If anyone can help with the set parameters to reach the aim, I would be so glad.

Carsten Received on Tue Aug 09 2005 - 10:02:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US