ODBC driver decimal culture format issue

Connectivity
Enthusiast

ODBC driver decimal culture format issue

Hello:

I'm using the Teradata ODBC driver 15.00.00.01 and testing Norwegian decimal localization in an application.  I created a table with a column with data type decimal(7,2). I inserted 120 and 1000.  When they come back from the data reader they come back as 12000 and 100000 so everything looks like it is getting multiplied by 100.  The Teradata .NET driver does not display this behavior and I also tested this with a DB2 ODBC driver and the data was returned from the ODBC Data Reader as expected.

My main culture is English (United States).  This occurs when I change date, time and numbers to Norwegian:

1. Go to Control Panel

2. Under "Clock Language and Region" click on the "Change date, time or number formats" link.

3. From the Format drop down select "Norwegian, Bokmal (Norway)" format.

4. Click "OK" to confirm changes.

Here is the table I created.

database <database_name>;

CREATE TABLE test

(col1 decimal(7,2))

PRIMARY INDEX (col1);

INSERT INTO test values(120); --This returned as 12000D in the odbc data reader. Formatted column is displayed as 12 000,00 instead of 120,00.

INSERT INTO test values(1000); --This is returned as 100000D in the odbc data reader. Formatted column is displayed as 100 000,00 instead of 1 000,00.

select * from test;

Thank you!

1 REPLY
Enthusiast

Re: ODBC driver decimal culture format issue

I also saw that I had Region also set to Norway under the Location tab.

1. Go to Control Panel

2. Under "Clock Language and Region" click on the "Change date, time or number formats" link.

3. From the Format drop down select "Norwegian, Bokmal (Norway)" format.

4. Click the Location tab and set region to Norway.

5. Click "OK" to confirm changes.