Page 1 of 1

LARGEINT ERROR WITH MYSQL5 and DELPHI RESOLVED

Posted: Fri 08 Feb 2008 15:37
by ioda
:!: 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

Posted: Fri 15 Feb 2008 06:59
by swierzbicki
Hi Guillaume,

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

Salut

Posted: Tue 19 Feb 2008 12:51
by Dimon
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.