Page 1 of 1

when EnableBCD=True, but numeric(16,2) will turn ftFloat

Posted: Mon 10 May 2010 04:07
by samin
I connect MSSQL2000, I see inside the help to have such a section:

Data Types
[3] - The appropriate Delphi type is chosen using the following sequence of rules:
EnableBCD is True and field precision, scale is less or equal 14,4 - uses ftBCD;
EnableFMTBCD is True - uses ftFMTBCD;
uses ftFloat.


Why has such definition?
I now am some fields am numeric(16,2),But set EnableBCD=True,
This field's type actually turned ftFloat, this was not I needs,
I did not want to turn ftFloat, ask how to solve?

Thanks

Posted: Mon 10 May 2010 04:12
by samin
my version is 3.0.0.8

Posted: Tue 11 May 2010 08:43
by Dimon
This limatation occurs because Delphi defines max bounds for TBcd fields like this:
MaxBcdPrecision = 18;
MaxBcdScale = 4;

Posted: Tue 11 May 2010 09:06
by samin
Dimon wrote:This limatation occurs because Delphi defines max bounds for TBcd fields like this:
MaxBcdPrecision = 18;
MaxBcdScale = 4;

MaxBcdPrecision = 18,
But UniDac is 14?

Posted: Tue 11 May 2010 09:18
by Dimon
But real Precision should be less or equal (MaxBcdPrecision - MaxBcdScale) and Scale <= MaxBcdScale.

Posted: Tue 11 May 2010 09:42
by samin
A field is numeric(18,2), we can evaluate are 123456789012345.12,
In BDE, I create TBCDField for it, it run very well
Showing, most greatly is not 14, but is 15

Posted: Tue 11 May 2010 13:17
by Dimon
Ok, we have fixed this problem. This fix will be included in the next UniDAC build.