Re: How many pre-decimal positions/integer digits has a DECimal (5,3) defined field ?

From: Knut Stolze <stolze_at_de.ibm.com>
Date: Sat, 09 Oct 2004 00:48:02 +0200
Message-ID: <ck75f2$6dd$1_at_fsuj29.rz.uni-jena.de>


Alex Filonov wrote:

> peterb_at_gmx.net (Peter Blatt) wrote in message
> news:<ck4ale$n5t$00$1_at_news.t-online.com>...

>> Does 5 represent the total numer of digits (including the fractional
>> portion) or only the number of places BEFORE the decimal point? Moreover
>> does the number include the decimal point?

According to the SQL standard (SQL99), subclause 4.5.1 (page 22) says:



An exact numeric value has a precision and a scale. The precision is a positive integer that determines the number of significant digits in a particular radix (binary or decimal). The scale is a non-negative integer. A scale of 0 (zero) indicates that the number is an integer. For a scale of S, the exact numeric value is the integer value of the significant digits multiplied by 10^(-s).

That makes it absolutely clear that for SQL database systems the precision (5 in the example above) is the total number of digits, including the fractional portion and without the decimal character.

-- 
Knut Stolze
Information Integration
IBM Germany / University of Jena
Received on Sat Oct 09 2004 - 00:48:02 CEST

Original text of this message