Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Padding to 'linesize' in SQL ?
Chrysalis wrote:
>
> Maurice De Vidts NE3S wrote:
> >
> > Hi,
> >
> > I am trying to build an export ascii file using 'spool'
> > and selecting from a varchar(2000) column. What I would like
> > to have is one record per line, with a linefeed at the end of each record.
> >
> > Since my columns are rather wide, I set linesize to 2000, and wrap OFF.
> > on output I do get my record in a single line, but it is padded up to
> > 2000 characters with blank spaces. Is there a way to avoid this ?
> >
> > i.i I would like a linefeed at the end of the string, regardless of
> > the length.
> >
> > Thanks
> >
> > Maurice De Vidts
> > ceham_at_w3eax.umd.edu
>
> Use the SQL*Plus setting "trimout on".
> This will not affect your terminal output, but should trim blanks from
> the end of your spool file.
> BTW, this can make a significant difference in the elapsed time for long
> reports.
>
> Chrysalis.
Actually, trimout only trims spaces from data displayed to the screen. The SET option that you need is TRIMSPOOL. This is a new option under SQL*Plus v3.2. It is not available on earlier version.
Bob
-- Bob Swisshelm Eli Lilly and Company swisshelm_at_lilly.comReceived on Fri Apr 11 1997 - 00:00:00 CDT