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: CHAR TO NUMBER - NUMBER TO CHAR

Re: CHAR TO NUMBER - NUMBER TO CHAR

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Fri, 28 Sep 2001 11:37:39 +0200
Message-ID: <9p1gd3$ucc$1@s1.read.news.oleane.net>

"Félix" <fgaitero_at_e-netfinger.com> a écrit dans le message news: 9p1ela$nsl$1_at_talia.mad.ttd.net...
> I have to converse a datatype from CHAR(4): '0004', to NUMBER: 4. Then I
> add 1 to this number: 4 + 1 = 5. I converse it to CHAR again but, when I
> select this value from the table I just get 5 and not 0005 as I want. It's
> still a CHAR(4) but it appears only with one character and not four as it
> should.
> How could I do to obtain '0005' and not '5' ?
> Thanks.
> Félix
>

v817>select to_char(to_number('0004','0000')+1,'0000') from dual;

TO_CH



 0005

1 row selected.

--
Have a nice day
Michel
Received on Fri Sep 28 2001 - 04:37:39 CDT

Original text of this message

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