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 leading zeros

Re: number leading zeros

From: Ed Prochak <prochak_at_my-deja.com>
Date: Thu, 11 Nov 1999 17:49:22 GMT
Message-ID: <80evj0$4a8$1@nnrp1.deja.com>


In article <382AE18E.8A2BA336_at_acsu.buffalo.edu>,   tmkong_at_buffalo.edu wrote:
> Can somebody tell me how to make a number column display exactly nine
> digits, including leading zeros if the number is less than nine digits
> long?
>
> I also need to know how to change column headings, for example, change
> LNAME to 'Last Name', etc
>
> I'm using Oracle 8
>
> Thanks.
> Tim K.
> tmkong_at_buffalo.edu
>

Here's a simple example doing both things within a SELECT statement:

SELECT LNAME 'Last Name', to_char(NUMBER_COLUMN,'0999999999') '9 digits' FROM MY_TABLE; You can also use the COLUMN command in SQL*Plus to change the formatting (and lots of other display options).

Enjoy.

--
Ed Prochak
Magic Interface, Ltd.
ORACLE Development, conversions, training and support 440-498-3700 magic_at_interfacefamily.com

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Nov 11 1999 - 11:49:22 CST

Original text of this message

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