Firebird NUMERIC() or DECILAM() data type

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
piobear
Posts: 1
Joined: Sat 03 Oct 2009 18:59

Firebird NUMERIC() or DECILAM() data type

Post by piobear » Sat 03 Oct 2009 19:05

IDE: D2007 + Firebird 2.1 + UniDAC 3.0.0.2

The documentation say that if used flag EnableBCD data type precision, scale up to 14,4 can be BCD but

NUMERIC(9,2) -> BCD
...
NUMERIC(10,4) -> float
DECIMAL(14,4) -> float

Any suggestion to fix?
Thanks

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 06 Oct 2009 08:07

The real precision of NUMERIC(10) and DECIMAL(14) is 18. This is peculiarity of InterBase. InterBase uses INTEGER to store fields with precision from 5 to 9, and BIGINT to store fields with precision from 10 to 18. You can insert value with 18 digits to NUMERIC(10) field. So BCD is not suitable for this field. You can use EnableFmtBCD instead.

Post Reply