Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


jasmin.dizdarevic
2017-02-23T08:51:27Z
Hi,

when doing a query against SQL-Server there is an unwanted conversion of numeric values.

"" "2,9665" "J" "0" "N" "" "" "15100,0000" "15.01.2012"
should be
"" "2.9665" "J" "0" "N" "" "" "15100.0000" "15.01.2012"

"Convert data types" is not checked in connection properties. Also not in ODBC-Settings.

Other ODBC-Tools are working well.

Locale of the VC-Server is: Germat(AT)
VC-Version: 8.2.5 beta
Sponsor
Forum information
thomas
2017-02-23T09:39:49Z
I don't think this has to do with types. It's just the formatting of numbers (regional settings) that is different on the db server vs VC server. I doubt this is something that VC controls. As you said, the local on your VC server is German, so the numbers will be displayed with comma.
jasmin.dizdarevic
2017-02-23T09:55:17Z
You're right. It's not just with SQL-Server - it's a general behavior.
The question is, if this is handy. In my case I'm exporting some db records to a file which will be processed by another program. The raw format for numbers in almost every database is to use . as decimal. Now, I have to deal with german locales, because the output has been transformed by "someone". If it's done by VC, an option would be great to output the data as they arrive from database (but of course as valid CSV - http://www.visualcron.co....aspx?g=posts&t=7087 )
thomas
2017-02-23T10:08:29Z
Ok I understand. I don't think this is possible, but I may be wrong about this. This is how it works in my mind:

VC receives data from SQL server. The number are of type int, float whatever. When it displays the result, the numbers are formatted (ie they are displayed as string type). If you want VC to display it using the setting from the Db server, then VC would have to know what the regional settings were on that server. This is not information it has access to. VC almost certainly uses the regional settings on the server it is installed.

As a quick fix, you can format the numbers in SQL. It's not pretty but it works:

Capture.PNG
al355
2017-02-23T10:37:24Z
Yes we mentioned this, we need something around this as well. The CSV spec allows for double quotes " around entities. So for example

ABC,123,"123,456,789",Test

jasmin.dizdarevic
2017-02-23T11:40:35Z
I see the problem now:

Console.WriteLine((2.5234).ToString());
//output: 2,25234
Console.WriteLine((2.5234).ToString(CultureInfo.InvariantCulture));
//output: 2.25234

Default behavior in .NET when casting to string is to output decimal number locale specific. With InvariantCultere the output would be ok - for me and my requirement.

@al355: Did you notice that the csv thing was solved in 8.2.5 beta?
al355
2017-02-24T11:46:57Z
We are not expecting any solution for now, this is a feature for the future
Scroll to Top