UnifiedSQL Functions TONUMBER and TOCHAR not working (MySQL)
Posted: Tue 14 Jun 2011 08:04
Hi
The UnifiedSQL Functions TONUMBER and TOCHAR not working with MySQL (UniDac 3.70.0.17 28-Apr-2011)
Here is my workaround in file "MySQLUniProvider.pas" on line 438 and 439. (works only on MySQL >= 5.0, see below)
DECIMAL may not working for MySQL < 5.0 (http://dev.mysql.com/doc/refman/4.1/en/ ... tions.html). Looks like its not possible to cast to a decimal in MySQL < 5.0. May you can handle that by checking the server version and cast to SIGNED on MySQL < 5.0.
Best regards
Elias Zurschmiede
The UnifiedSQL Functions TONUMBER and TOCHAR not working with MySQL (UniDac 3.70.0.17 28-Apr-2011)
Here is my workaround in file "MySQLUniProvider.pas" on line 438 and 439. (works only on MySQL >= 5.0, see below)
Code: Select all
// EZ: changed to DECIMAL according to MySQL manual (http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html)
MyFunctions.AddObject('TONUMBER', TObject(PChar('CAST(%s AS DECIMAL)')));
// EZ: changed to CHAR according to MySQL manual (http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html)
MyFunctions.AddObject('TOCHAR', TObject(PChar('CAST(%s AS CHAR)')));
Best regards
Elias Zurschmiede