Decimal separator with connection over Ole DB
442969Apr 28 2005 — edited Jun 2 2005Hello,
I tries to describe the problem (and sorry for my english). Our application can access the Oracle over OCI or over Oracle Ole DB provider.
The Registry key under HKEY_LOCAL_MACHINE\...\KEY_OraDb10g_home1: NLS_LANG has the value âGERMAN_GERMANY.WE8MSWIN1252â.
Nevertheless a simple command: âselect 1/4from dualâ over Oracle Ole DB supplies the following result: â.25â!
We found out that with the access over Ole DB the following command:
select * from NLS_SESSION_PARAMETERS
supplies the following results:
PARAMETER VALUE
NLS_LANGUAGE GERMAN
NLS_TERRITORY GERMANY
NLS_CURRENCY â¬
NLS_ISO_CURRENCY GERMANY
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT YYYY-MM-DD HH24:MI:SS
NLS_DATE_LANGUAGE GERMAN
NLS_SORT GERMAN
NLS_TIME_FORMAT HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT DD.MM.RR HH24:MI:SSXFF
NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT DD.MM.RR HH24:MI:SSXFF TZR
NLS_DUAL_CURRENCY â¬
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
It is notably that values of 2 parameters (NLS_NUMERIC_CHARACTERS und NLS_DATE_FORMAT) differ from the values, which are selected over OCI:
PARAMETER VALUE
NLS_NUMERIC_CHARACTERS ,.
NLS_DATE_FORMAT DD.MM.RR
That enough are already strangely. But it continues however. We inserted the following: directly after the Connect the variable NLS_NUMERIC_CHARACTERS is changed:
ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ',.'.
Now the command âselect 1/4from dualâ supplies correctly formatted result: â,25â.
BUT NOT ON MY COMPUTER!
If the program runs on my computer, â.25â is still returned!
Does someone have an idea, what can be the reason for it? What else affects formatting here? I repeat: it happens only with connection over Oracle Ole DB provider!
And on the Client all land settings (and numeric settings) in Windows are correctly set for Germany.