Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Plus reporting question
Using prompt column1, column2.... what Richard suggested would be my
solution too.
I suggest you add
set trimspool on
When set off every line is padded with spaces up till the linesize.
Trimspool on can reduce the size of the spool file a lot.
But the tool that is going to read the spoolfile must be able to deal with
this.
D Newsham <d_newsham_at_hotmail.com> schreef in berichtnieuws
c883e8dd.0205211008.3b605ef1_at_posting.google.com...
| Hi,
|
| I hope I am posting to the right group. If not please let me know as
| I don't like to cross-post.
|
| I have written a query to produce a csv file from SQL*Plus. I also
| need the headers to come out as a single line, comma separated. Can
| this be done?
|
| So far I have discovered that I can turn the headers off, make them
| come out in one single string, or be separated by space with an
| underline underneath. I really need the headers to come out in a
| single, comma separated line so my client can import it into Excel
| without having to type in all of the column headers.
|
| Here is what I have so far (actual file contains about 60 columns):
|
| set heading off pagesize 0 linesize 2000 feedback off
|
| spool testfile
| SELECT
|
| column_1||','||
| column_2||','||
| column_3||','||
|
| FROM test_table
| order by column_1,column_2,column_3
| /
| spool off
|
|
| Thanks!
| Dina
Received on Tue May 21 2002 - 16:09:52 CDT