PDA

View Full Version : Forcing leading zero


Ishan
06-04-02, 14:40
How can I force a number to have leading zeros ?

select '123456' from dual;

I have try using TO_NUMBER :

select TO_NUMBER('123456','00999999') from dual;

But it doesn't seems to work. It will conserve the leading zeros but I want to add some.

Ishan
06-04-02, 14:45
Hehe.. sorry I get it, I just have to use TO_CHAR instead of TO_NUMBER

alligatorsql.com
06-04-02, 18:50
Thatīs the way it is :)

Greetz

Manfred Peter
(Alligator Company)
http://www.alligatorsql.com