Re: PL/SQL

From: Ms. D.H. Harvey <qq45_at_liverpool.ac.uk>
Date: 1 Dec 1999 15:05:42 GMT
Message-ID: <823dg6$olr$1_at_news.liv.ac.uk>


Michel Cadot (micadot_at_netcourrier.com) wrote:
: Paul,
: your function is a good example to begin with PL/SQL
: but i'm not agree with you when you say:
: "there is no easy way in SQL*PLUS to format a number
: with decimal places to print out as 000123.4500",
: the function TO_CHAR can do this:

: v734> create table padnum (col number);
: v734> insert into padnum values(1234.56);
: v734> insert into padnum values(123.456);
: v734> insert into padnum values(12345.678);
: v734> insert into padnum values(123);
: v734> select to_char(col, '000000.0000') from padnum;

: TO_CHAR(COL,
: ------------
: 001234.5600
: 000123.4560
: 012345.6780
: 000123.0000

: --
: Regards
: Michel

Or you could:

SQL> column col format 000000.0000
SQL> select col from padnum;

         COL


 001234.5600
 000123.4560
 012345.6780
 000123.0000

Helen Received on Wed Dec 01 1999 - 16:05:42 CET

Original text of this message