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 -> Re: formatting output with SQL*Plus

Re: formatting output with SQL*Plus

From: Thomas Kellerer <NNGNVRDSJEBN_at_spammotel.com>
Date: Wed, 08 Dec 2004 20:13:49 +0100
Message-ID: <cp7jpd$kf1$1@svr7.m-online.net>


Niall Litchfield wrote on 08.12.2004 19:26:
>>spool output.txt
>>
>>SELECT column1,column2, column3
>>FROM my_table;
>>
>>spool off
>>
>>Is there any way to remove the trailing spaces in the column values?

> 
> 
> cheap and ugly select trim(column1),trim(column2) ....

I tried trim() already, but it does not work SQL*Plus pads the resulting _value_ to the length of the column. If I do e.g. the following:

SELECT trim(column1)||'<',trim(column2)
FROM my_table;

I get the following (. to denote a space)

value1<......................,value2.......................

So the value itself if trimmed (as can be verified by the < sign right after it) but the SQL*Plus puts spaces in the output to get this "table like" formatting.

Cheers
Thomas Received on Wed Dec 08 2004 - 13:13:49 CST

Original text of this message

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