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 question

Re: SQL*Plus question

From: Eric DANTIE <edantie_at_rcanaria.es>
Date: Thu, 13 May 1999 20:01:13 +0100
Message-ID: <373B2179.57E4B33B@rcanaria.es>


Jimmy wrote:
>
> Hello all,
>
> I have the following sql file running in SQL*Plus:
>
> spool a.txt
> select columnA || ',', columnB || ',', columnC || ',', columnD from
> AAA;
> spool off
>
> Results: (content of a.txt)
> columnA, columnB, columnC, columnD
> 11, ABC, 01-Jan-1998, Testing
> 1234, DEFG, 01-Jan-1999, Hello This is testing
>
> 134, A, , Testing
> Testing...
>
> However, I want to use SQL*PLUS to get the following results:
>
> Results: (content of a.txt)
> columnA,columnB,columnC,columnD
> 11,ABC,01-Jan-1998,Testing
> 1234,DEFG,01-Jan-1999,Hello This is testing
> 134,A,,Testing Testing
>
> i.e., no space between two column values. Is it possible to do that
> in running sql file in SQL*Plus?
>
> Thanks,
> Jimmy

Use a select ltrim(rtrim(columname,' '),' ') from AAA;

Eric Received on Thu May 13 1999 - 14:01:13 CDT

Original text of this message

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