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

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
samin
Posts: 16
Joined: Mon 10 May 2010 03:58

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

Post by samin » Mon 10 May 2010 04:07

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

samin
Posts: 16
Joined: Mon 10 May 2010 03:58

Post by samin » Mon 10 May 2010 04:12

my version is 3.0.0.8

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 11 May 2010 08:43

This limatation occurs because Delphi defines max bounds for TBcd fields like this:
MaxBcdPrecision = 18;
MaxBcdScale = 4;

samin
Posts: 16
Joined: Mon 10 May 2010 03:58

Post by samin » Tue 11 May 2010 09:06

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?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 11 May 2010 09:18

But real Precision should be less or equal (MaxBcdPrecision - MaxBcdScale) and Scale <= MaxBcdScale.

samin
Posts: 16
Joined: Mon 10 May 2010 03:58

Post by samin » Tue 11 May 2010 09:42

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

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 11 May 2010 13:17

Ok, we have fixed this problem. This fix will be included in the next UniDAC build.

Post Reply