Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: formatting output with SQL*Plus
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