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: NUMBER to CHAR conversion

Re: NUMBER to CHAR conversion

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Thu, 6 Apr 2000 09:25:13 +0200
Message-ID: <8che5a$8h3$1@news4.isdnet.net>


to_char(1,'00') is ' 01', so it needs 3 characters (there's a character for the sign).
If you don't want that you can use 'fm00' format: v734> select '"'||to_char(1,'00')||'"' nb from dual;

NB



" 01"

v734> select '"'||to_char(1,'fm00')||'"' nb from dual;

NB



"01"

--
Have a nice day
Michel

Alec Perminov <V.Prosekin_at_vaz.ru> a Êcrit dans le message : 8ch706$8ha$1_at_ss20.vaz.ru...
> Can anybody help me?
> Why the statement:
>
> INSERT INTO sample_table VALUES(TO_CHAR(1,'00'));
>
> returns error:
>
> ERROR at line 1:
> ORA-01401: inserted value too large for column
>
> There is 'sample_field' CHAR(2) in 'sample_table'. I thought the
statement
> have
> to write value '01' in the field. But it does not work. Why?
>
> Alec.
>
Received on Thu Apr 06 2000 - 02:25:13 CDT

Original text of this message

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