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: Oralce BUG or feature???

Re: Oralce BUG or feature???

From: Ginger <gingergrrrl_at_hotmail.com>
Date: 1998/09/28
Message-ID: <360FC8F8.446D39D7@hotmail.com>#1/1

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

Original text of this message

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