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?
TUniLoader: how to set decimal separator
Re: TUniLoader: how to set decimal separator
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.
-
- Posts: 19
- Joined: Mon 12 May 2014 14:16
Re: TUniLoader: how to set decimal separator
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.
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
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.
-
- Posts: 19
- Joined: Mon 12 May 2014 14:16
Re: TUniLoader: how to set decimal separator
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.
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
It is good to see that the problem has been solved.