Different behaviour between Oracle Client and Devart with DirectMode = false

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
hansjoergp
Posts: 39
Joined: Wed 31 May 2017 14:33

Different behaviour between Oracle Client and Devart with DirectMode = false

Post by hansjoergp » Tue 06 Nov 2018 14:08

Hello,

we have an database with a Oracle 9.2 Database

V$NLS_PARAMETERS:
NLS_LANGUAGE GERMAN
NLS_TERRITORY GERMANY
NLS_CURRENCY €
NLS_ISO_CURRENCY GERMANY
NLS_NUMERIC_CHARACTERS ,.
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-Mon-RRRR
NLS_DATE_LANGUAGE GERMAN
NLS_CHARACTERSET WE8MSWIN1252
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_NCHAR_CHARACTERSET AL16UTF16
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE

If I have an OracleClient installed which does not have in the regedit the NLS_LANG parameter set (DirectMode=false) then the special characters like 'öä'... are written wrong to the database. If I use only the OracleClient and also with devart in DirectMode=true, everything works fine

Regards
Hansjörg

hansjoergp
Posts: 39
Joined: Wed 31 May 2017 14:33

Re: Different behaviour between Oracle Client and Devart with DirectMode = false

Post by hansjoergp » Wed 07 Nov 2018 10:34

I don't understand what this has to do with my entry.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Different behaviour between Oracle Client and Devart with DirectMode = false

Post by Pinturiccio » Mon 12 Nov 2018 15:02

When the OCI connection mode is used in dotConnect for Oracle, all the work with NLS Parameter is performed by Oracle Client. For more information, please refer to https://www.oracle.com/technetwork/prod ... 99431.html

You can use the "Run Once Command" connection string parameter to set the necessary NLS_LANG value. For example, add the following string to your connection string:

Code: Select all

"Run Once Command=ALTER SESSION SET NLS_LANGUAGE='German';"

In the Direct mode NLS parameters are based on the regional settings of your Operating system.

You can also add "Unicode=true" to your connection string in both modes: Direct and OCI. In this case all special characters will be passed correctly.

hansjoergp
Posts: 39
Joined: Wed 31 May 2017 14:33

Re: Different behaviour between Oracle Client and Devart with DirectMode = false

Post by hansjoergp » Fri 16 Nov 2018 09:23

If I use directly the OracleClient (System.Data.OracleClient) I have a different behaviour

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Different behaviour between Oracle Client and Devart with DirectMode = false

Post by Pinturiccio » Wed 21 Nov 2018 15:04

System.Data.OracleClient was deprecated a long time ago. We do not think that behavior of this provider should be a guideline.
When you use the OCI connection mode with dotConnect for Oracle, all the work is performed by Oracle Client, including applying the NLS Parameter.

Post Reply