BCD overflow

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
PaulG
Posts: 5
Joined: Fri 28 Oct 2005 13:55
Location: UK

BCD overflow

Post by PaulG » Tue 14 Feb 2006 10:01

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

PaulG
Posts: 5
Joined: Fri 28 Oct 2005 13:55
Location: UK

Post by PaulG » Wed 15 Feb 2006 11:46

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.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 16 Feb 2006 09:52

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.

Post Reply