Subject Re: [Firebird-Architect] NUMERIC vs DECIMAL Helen Borrie 2003-08-06T10:21:41Z
At 12:06 PM 6/08/2003 +0200, Pavel Cisar wrote:
>Hi,
>
>On 6 Aug 2003 at 19:45, Helen Borrie wrote:
>
> > What is the "real oil" on NUMERIC vs DECIMAL?
> >
> > Is the InterBase docco correct in saying that NUMERIC(p, s) has a
> precision
> > of not more than p, whilst DECIMAL(p, s) has a precision of at least p?
>
>AFAIK NUMERIC is the same as DECIMAL (i.e. can store more digits, at
>least p) but can store less than DeCIMAL to certain defined precisions
>due to smaller storage type:
>
>DECIMAL precision 1 ¯4 INTEGER (32bit)
>NUMERIC precision 1 ¯4 SMALLINT (16bit)
>
>DECIMAL precision 5 ¯9 INTEGER (32bit)
>NUMERIC precision 5 ¯9 INTEGER (32bit)
>
>DECIMAL precision 10 ¯18 INT64 or DOUBLE PRECISION (64bit)
>NUMERIC precision 10 ¯18 INT64 or DOUBLE PRECISION (64bit)
>
>As you can see, they only differ in small precisions up to 4 digits.

And the first pair is true for both Dialect 1 and Dialect 3? (I REALLY
want to believe it is, to justify the existence of two f/d types! :-)

The IB 7 documentation has two tables printed one after the other on pp.
4-7 and 4-8 of the Data Definition Guide. The first one says that the
above (i.e. as you have it for precision 1-4) is true for D1, whereas in
D3, both decimal and numeric are stored as smallint. The second table
doesn't distinguish between dialects, and says what you say above.

Are you, or is anyone, close enough to the code that decides what to store,
to say categorically that the IB 7 documentation is in error regarding
Dialect 3? I know I'm being a pain, but it's in pursuit of accuracy...

thks,
Helen