Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oralce BUG or feature???
try this:
select lpad(to_char(fieldname),4,'0') from tablename;
lpad is a character function and you must convert your value to character BEFORE doing lpad, not after.
NNOOR wrote:
> Thomas,
> I omitted an important information which would explain the behaviour
> I got from LPAD.
>
> the LPAD was surrouned by TO_CHAR, i.e.
> Select to_char(LPAD(...)) from ...
>
> Further study into the to_char function explained getting the
> results that I got (612 instead of expected 0612 in my example).
>
> Thanks for help!
> Regards,
> Nasir (nnoor_at_cris.com)
Received on Mon Sep 28 1998 - 00:00:00 CDT