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: Function TO_CHAR

Re: Function TO_CHAR

From: Peter van Rijn <p.vanrijnRM_at_THISzhew.nl>
Date: Thu, 4 Nov 2004 11:19:59 +0100
Message-ID: <10ok0akdaoiks35@corp.supernews.com>

"Petr Benes" <benes_at_epos.cd.cz> schreef in bericht news:4189e1f4.0_at_10.140.56.22...
> Hi
>
> Expression TO_CHAR(15) returns '15'. It is correct.
> Expression TO_CHAR(15,'0999') returns ' 0015' instead '0015'.
> Tested in version 10q as well as 7.3.4.
>
> Do you know why there is the blankspace?
>
> Thanks
>
>

Because it is documented that way. :-)

From SQL-Reference:

"Element Example Description"
"9 9999 Returns value with the specified number of digits with a leading space if positive or with a leading minus if negative."

The leading space is not specifically being caused by the "0", but by the "9" format in general.

Peter Received on Thu Nov 04 2004 - 04:19:59 CST

Original text of this message

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