Hello
Problem is that the DataTypeMap Delphi data type is responsible for equivalence between database data types and Delphi data types.
In the Delphi 7 this type declared as:
Code: Select all
DataTypeMap: array[0..MAXLOGFLDTYPES - 1] of TFieldType = (
ftUnknown, ftString, ftDate, ftBlob, ftBoolean, ftSmallint,
ftInteger, ftFloat, ftBCD, ftBytes, ftTime, ftDateTime,
ftWord, ftInteger, ftUnknown, ftVarBytes, ftUnknown, ftCursor,
ftLargeInt, ftLargeInt, ftADT, ftArray, ftReference, ftDataSet,
ftTimeStamp, ftFMTBCD);
Data type with the BCD data type (code

will be mapped to the ftBCD Delphi data type.
But in the Delphi 2007 the ftBCD data type is removed at all:
Code: Select all
DataTypeMap: array[0..TDBXDataTypes.MaxBaseTypes - 1] of TFieldType = (
ftUnknown, ftString, ftDate, ftBlob, ftBoolean, ftSmallint,
ftInteger, ftFloat, ftFMTBCD, ftBytes, ftTime, ftDateTime,
ftWord, ftInteger, ftUnknown, ftVarBytes, ftUnknown, ftCursor,
ftLargeInt, ftLargeInt, ftADT, ftArray, ftReference, ftDataSet,
ftTimeStamp, ftFMTBCD, ftWideString);
Data type with the BCD data type (code

and with the FMTBCD data type (code 25) both will be mapped to the ftFMTBCD Delphi data type.
In the Delphi 2009 the ftBCD Delphi data type was returned but it has invalid index:
Code: Select all
DataTypeMap: array[0..TDBXDataTypes.MaxBaseTypes - 1] of TFieldType = (
ftUnknown, ftString, ftDate, ftBlob, ftBoolean, ftSmallint,
ftInteger, ftFloat, ftFMTBCD, ftBytes, ftTime, ftDateTime,
ftWord, ftInteger, ftUnknown, ftVarBytes, ftUnknown, ftCursor,
ftLargeInt, ftLargeInt, ftADT, ftArray, ftReference, ftDataSet,
ftTimeStamp, ftBCD, ftWideString);
You can find this declaration in the “SqlExpr.pas” file in each Delphi version. If try to use native dbExpress driver for Oracle then you find same behavior: it will return ftFMTBCD data type for the column in the Delphi 2009 because of the DataTypeMap data type declaration.
So if you want to get ftBCD Delphi data type for your field then you should ask Embarcadero (owner of Delphi) to restore declaration of the DataTypeMap data type.