Page 1 of 1

TUniLoader: how to set decimal separator

Posted: Wed 16 Jul 2014 08:07
by martin.trummer
I use TUniLoader to insert data into a MySQL database.
on a customer PC the insert fails with this error: "data truncated for column xxx"

the column is of type double and by looking at the executed sql statements I found out that the query uses a comma as decimal separator - but the database expects a dot.

how/where can I set the decimal separator that TUniLoader will use?

Re: TUniLoader: how to set decimal separator

Posted: Wed 16 Jul 2014 15:10
by PavloP
We can't reproduce the problem. Please try to compose a small sample to demonstrate the problem and send it to pavelp*devart*com. In addition, specify the exact versions of UniDAC and Delphi you are using.

Re: TUniLoader: how to set decimal separator

Posted: Wed 16 Jul 2014 15:13
by martin.trummer
The problem occurs only one one customer PC.
In the meanwhile I have changed the regional settings of that PC to English and now it works (was German before).

but this is NOT an acceptable solution for the customer - so I need another way to specify the decimal separator.
it seems that the TUniLoader uses the value from the system's regional settings. But this is not a good idea, because actually it must use the separator that the database server expects.

Re: TUniLoader: how to set decimal separator

Posted: Thu 17 Jul 2014 13:15
by PavloP
Not at all, we replace regional decimal separator in SQL queries with a separator used by the server. Please provide your table structure and data loading code example for problem investigation.

Re: TUniLoader: how to set decimal separator

Posted: Mon 28 Jul 2014 15:56
by martin.trummer
I found the problem now.
in my program, the datatype of the column (for the TUniLoader) had not been set: default is ftString. Thus the float was converted to a string before sending to the database. this conversion uses the system settings.

Re: TUniLoader: how to set decimal separator

Posted: Tue 29 Jul 2014 09:46
by PavloP
It is good to see that the problem has been solved.