LARGEINT ERROR WITH MYSQL5 and DELPHI RESOLVED

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ioda
Posts: 12
Joined: Fri 08 Feb 2008 15:11

LARGEINT ERROR WITH MYSQL5 and DELPHI RESOLVED

Post by ioda » Fri 08 Feb 2008 15:37

:!: Solutions infromatiques Pelluc enjoy to you send the solution about LargInt :!:

Hi,
After I installed MyDac with Delphi and MySQL 5, I received new error. This error is : MyDac always return LargInt value when I use MySQL alias. After to try different way, change Delphi vcl, update MySQL..... I find one solution to resolve the problem. :)

My solution have two restrictions to work :(
1: You need MySQL 5 or more
2: Your value doesn't exceed "9 999 999 999" value

So, I'll explain how we can resolve the problem. This is very simple but you have to think about it. we need to create a new function to return Int(9). This is my SQL query like this.
CREATE FUNCTION INTCAST(param INTEGER) RETURNS INT(9) DETERMINISTIC
BEGIN
RETURN param;
END

After this we can call this functin like this in SQL query
Select INTCAST(0) AS TOT

If you use this, MyDac alway return Integer value in delphi and the problem is resolve :P :P :P :P :P :P. I use this function in all my software and all work correctly. 8)

Guillaume Corneau

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Fri 15 Feb 2008 06:59

Hi Guillaume,

Thank you for the workarround :)
This will helps until Corelab correct this in their component.

Salut

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

Post by Dimon » Tue 19 Feb 2008 12:51

New build of MyDAC version 5.20.1.14 has been released. There is TCustomMyConnectionOptions.OptimizedBigInt property added to map LargeInt fields to Integer fields.

Post Reply