Subject Re: [Firebird-Architect] NUMERIC vs DECIMAL
Author Martijn Tonies
> > > - Both numeric and decimal behave the same. Numeric isn't SQL
compliant
> > > currently.
> > >
> > > - For both dialects, being "p" the precision, the internal storage is:
> > > 1 <= p <= 4 => smallint
> >
> > Are you sure ? I'd swear that decimal is stored as INTEGER (32bit) as
> > documented. I checked that some time ago on FB 1.0.2 (? don't remember,
> > but I'd also swear this apply to both dialects). But my memory is often
> > lousy, so the reality check is needed.
>
> Pavel is right. Simple test reveals that SHORT is used only for
NUMERIC(<=4,x), not for DECIMAL:
>
> CREATE TABLE T(
> D4 DECIMAL(4,1),
> N4 NUMERIC(4,2),

Needless to say this stuff is all very sucky for tool developers
(isql included) and extract metadata... pff... Luckily, ODS10
brings RDB$SCALE ... that helps. A bit.


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com