Page 1 of 1

Firebird NUMERIC() or DECILAM() data type

Posted: Sat 03 Oct 2009 19:05
by piobear
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

Posted: Tue 06 Oct 2009 08:07
by Plash
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.