Page 1 of 1

BCD fields and FMTBCD fields

Posted: Mon 26 May 2014 20:41
by andrewsvaz
Hi all,

So I was reading in the Web docs about the BCD field and FMTBCD Field and some things aren't exactly clear to me.

I have a Field defined in a Firebird database that is:


and when I open the Fields Editor and add the fields in a TUniQuery, it shows up as FloatField if I have the EnableBCD = True, and if I have the EnableFMTBCD = True it shows up as a FMTBCDField.

As in the Docs at ... _types.htm
shows that
ftBCD -> DECIMAL(p, s) where (p < 15) and (s < 5)
ftFMTBCD -> DECIMAL(p, s) where (14 < p < 19) and(4 < s < 19)

Shouldn't the field showed up as a BCDField?

My doubt, Can I use the FMTBCDField without any problems? Willl this behaviour change in the next versions? is there any significant diference? (I believe not, but better ask now than being sorry later).

I am working with a lot a money operations and the BCDfield has always been the type that I used.

Using XE3 and Unidac 5.3.8 with Firebird 2.53

Just another thing, will the currency property at the field level make any diference?


Re: BCD fields and FMTBCD fields

Posted: Tue 27 May 2014 08:32
by ZEuS
Thank you for the information. We have fixed the error with incorrect DECIMAL fields mapping in UniDAC.
We have added the "SimpleNumericMap" connection specific option for InterBase provider. You should set the option to "False" to force fields like DECIMAL(14, 4) be mapped as ftBCD when EnableBCD is True. The default option value is "True".
The fix will be included in the nearest UniDAC build. We plan to release the build this week.

Re: BCD fields and FMTBCD fields

Posted: Tue 27 May 2014 14:08
by andrewsvaz
Ok, good to know that I can help with something.

In the meantime, is there a workaround other than setting all the desired fields to BCD fields with the DataMapper?


Re: BCD fields and FMTBCD fields

Posted: Wed 28 May 2014 07:01
by ZEuS
For now, in UniDAC all fields are mapped either as TFloatField or as TFmtBcdField, depending on the EnableFMTBCD option value. You can use Data Type Mapping as a workaround unless we release the UniDAC build.

Re: BCD fields and FMTBCD fields

Posted: Tue 19 Mar 2019 14:54
by Kuri_YJ

We also need seperation for BCD and FMTBCD fields in Data Mapping for Decimal fields on Database Informix ODBC driver. We can not seperate it. Is there any idea?

Re: BCD fields and FMTBCD fields

Posted: Fri 05 Apr 2019 17:16
by MaximG
The properties you mention are obsolete and are present in our components only for backward compatibility. Currently, you can use DataTypeMapping -
special mechanism provided by our components. It allows you customizing the type conversion in the most flexible way, for example:

Code: Select all

uses ODBCDataTypeMapUni;
     UniQuery.DataTypeMap.AddDBTypeRule(odbcDecimal, ftBCD);
The detailed description of this mechanism processing can be found in our documentation: ... pping.htm