Page 1 of 1
BCD overflow
Posted: Tue 14 Feb 2006 10:01
by PaulG
I have a problem that only occurs in one part of a large system. On the first attempt to read a value from a DECIMAL(15,2) type column using the AsCurrency method of a TSQLQuery component a "EDataError - BCD overflow" exception is raised. Which particular row or table is being read from makes no difference. I cannot reproduce the problem in a small application. Any ideas?
Delphi 7.0
dbexpmda.dll 3.0.1.0
MySQL 5.0.18
Posted: Wed 15 Feb 2006 11:46
by PaulG
To reproduce this problem:
Create a table with one column called Amount of type DECIMAL(15,2)
Add one row to the table with 12.34 as the value for Amount
In Delphi set up TCRSQLConnection and TSQLQuery components
Call SQLQuery1.FieldByName('Amount').AsCurrency
If the TCRSQLConnection's FetchAll parameter is set to False a BCD Overflow exception should be raised. Using different values for Amount can result in 0 being returned rather than an exception being raised.
Posted: Thu 16 Feb 2006 09:52
by Ikar
Thank you for information.
We reproduced your problem and fixed it. This fix will be included in the next DbxMda build. As temporary solution to avoid this problem you can set FetchAll to True.