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 -> Odd results from TO_CHAR()

Odd results from TO_CHAR()

From: <pbolduc_at_online-can.com>
Date: Tue, 26 Jan 1999 01:50:01 GMT
Message-ID: <78j707$mqg$1@nnrp1.dejanews.com>

Why does this happen:

   select 'x'||to_char(1,'00')||'x' from dual;

 returns: 'x 01x'

I would have expected: 'x01x'

I know I could do: select 'x'||ltrim(to_char(1,'00'))||'x' from dual; to get the same result but it seems convoluted.

Oracle7 Server Release 7.3.2.3.0 - Production Release PL/SQL Release 2.3.2.3.0 - Production
CORE Version 3.5.2.0.0 - Production
TNS for HPUX: Version 2.3.2.1.0 - Production NLSRTL Version 3.2.2.0.0 - Production

Phil Bolduc

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Jan 25 1999 - 19:50:01 CST

Original text of this message

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