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: Remington XU <remxub_at_earthlink.net>
Date: 1998/09/26
Message-ID: <6uio5m$n35$1@holly.prod.itd.earthlink.net>#1/1

Have you trie Lpad(to_char(class_code,4,'0')) ?

NNOOR wrote in message <6uh220$f8u_at_chronicle.concentric.net>...
>
>I am using Oracle 7.3.3 on NT 4.
>
>I have a table with a field of type VARCHAR(5). It has numerical
>values in it. I was trying to pad zeros at the front of it (e.g.
>612 would become 0612), that's when I discovered this behaviour
>of LPAD function:
>
>select LPAD(class_code, 4, '0') from tableName
>returns only the original value. For example 612 comes back
>as 612 and not 0612.
>
>select LPAD(class_code, 4, 'A') from tableName
>returns nothing!
>
>RPAD seems to work OK. I guess that internally Oracle is treating
>the numerical values as true number and not char.
>
>How do I pad leading zero's in a varchar field?
>
>Thanks.
>Nasir (nnoor_at_cris.com)
Received on Sat Sep 26 1998 - 00:00:00 CDT

Original text of this message

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