Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: number leading zeros
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