[SOLVED] Does MySQL always expects point as decimalseparator on INSERT ? lazarus / 16-Databases ---------------------------------------------------------------------- mirce.vladimirov · 2011-04-30 12:08 When using default settings, decimalseparator=. (point) and thousendSeparator=, (comma) my application works as expected, but I decided to change the settings in ControlPanel->RegionalSetings I set the decimalseparator=, (comma) and thousendSeparator=. (point). When I retrieve data from database it works fine, it's all formated to have the comma as a decimalseparator. I do formatfloat, strtofloat, floattostr...it works as expected. But, it fails if i try to insert, it reports Exception, data truncated... I also tried to retrieve a float value from one table and insert it to another, and that also doesnot work. Code: [Select]table1_query.SQL.text:='insert into table1 values (:field1, :float1, :float2)'; table1_query.Params.ParamByName('field1').value:=1; table1_query.Params.ParamByName('float1').value:=table2_query.fieldbyn ame('float_nr1').value ; table1_query.Params.ParamByName('float2').value:=table2_query.fieldbyn ame('float_nr2').value ; I'm using Lazarus 0.9.30 and MySQL under windows XP, and I also tested generated EXE file under win7. ---------------------------------------------------------------------- JimBeam · 2011-04-30 14:45 Hi, You could try to explicitly define the db datatype of the parameter, something like table1_query.Params.ParamByName('float1').DataType := ftInteger; for integer values. Of course you would use something like float. I suspect the default datatype is string or text, so that may be why it goes wrong... HTH, jb ---------------------------------------------------------------------- mirce.vladimirov · 2011-04-30 20:46 Thank you JimBeam, It works now. After your answer, I also tried this : Code: [Select]table1_query.Params.ParamByName('float1').asFloat:=table 2_query.fieldbyname('float_nr1').asFloat; See that ? I replaced that  ".value" at the end of the statement by ".asFloat". That works too. Thanks a lot. ---------------------------------------------------------------------- JimBeam · 2011-05-04 11:21 Glad it works