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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Plus reporting question

Re: SQL*Plus reporting question

From: Bricklen Anderson <bricklen_at_shaw.ca>
Date: Tue, 21 May 2002 18:29:41 GMT
Message-ID: <3CEA9126.52CFD644@shaw.ca>


set wrap off will maintain one line, although it will chop off your data if it exceeds your linesize (IIRC). You may want to format the columns to be as narrow as possible (depending on the data) like so:

column COLUMN_NAME_A format a16 (or 9999999 etc for numeric columns)

(if you already know how to do all this, then I apologize - just figured it'd save you another post if not)

How are you getting the column headers? From user_tab_columns? or are you just inputting that manually?

Cheers,

Bricklen

D Newsham wrote:
>
> 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 - 13:29:41 CDT

Original text of this message

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