Path: news.f.de.plusline.net!news-fra1.dfn.de!news.tele.dk!feed118.news.tele.dk!postnews.google.com!l53g2000cwa.googlegroups.com!not-for-mail
From: "Mark D Powell" <Mark.Powell@eds.com>
Newsgroups: comp.databases.oracle.misc
Subject: Re: Number Data Type
Date: 2 Feb 2007 07:14:28 -0800
Organization: http://groups.google.com
Lines: 67
Message-ID: <1170429268.011831.148250@l53g2000cwa.googlegroups.com>
References: <1170422468.157057.306180@v45g2000cwv.googlegroups.com>
   <1170425246.321183.192000@v33g2000cwv.googlegroups.com>
NNTP-Posting-Host: 192.85.50.2
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1170429273 19249 127.0.0.1 (2 Feb 2007 15:14:33 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 2 Feb 2007 15:14:33 +0000 (UTC)
In-Reply-To: <1170425246.321183.192000@v33g2000cwv.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: l53g2000cwa.googlegroups.com; posting-host=192.85.50.2;
   posting-account=J7QqBQwAAABTieek3RP_669Gs2iATWzr
Xref: news.f.de.plusline.net comp.databases.oracle.misc:77896

On Feb 2, 9:07 am, "Ed Prochak" <edproc...@gmail.com> wrote:
> On Feb 2, 8:21 am, muralidhar...@hotmail.com wrote:
>
> > Hi All,
>
> > I am using Oracle 10g database.
> > I have a table with field name "Amount" and its datatype is
> > Number(7,2).
> > If I enter the amount value as 10.23, it is stored beautifully in the
> > database.
> > But, if I enter the amount value as 10.00, it is getting truncated and
> > stored in the databse as only 10 (The decimal part is not stored in
> > the database if both the digits in the decimal part are zeros')
>
> > Can any one help me in understanding this, and how to over come this?
>
> > Thanks in advance,
> > Murali.
>
> What makes you think the decimal part is not stored?
>   1  create table ejptest (
>   2  amount  number(7,2)
>   3* )
> SQL> /
>
> Table created.
>
> SQL> insert into ejptest values (10.23);
>
> 1 row created.
>
> SQL>  insert into ejptest values (10.00);
>
> 1 row created.
>
> SQL> select * from ejptest ;
>
>     AMOUNT
> ----------
>      10.23
>         10
>
> SQL> column amount format 99999.99
> SQL>  select * from ejptest ;
>
>    AMOUNT
> ---------
>     10.23
>     10.00
>
> SQL>
>
> Don't confuse the display format with the storage format.
>    Ed

Ed, is correct in that you can display the number any way you want by
using the to_char function with a numeric format or in SQLPlus use the
column command to format your output.

Oracle does not store leading or tailing zeroes in the internal number
format as it is a form of scientific notation.  How many leading
zeroes, if any, and how many decical places you display on output are
formatting considerations.

HTH -- Mark D Powell --


