NLS_LANG not taken from selected Oracle_Home

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
HarleighMaguire
Posts: 1
Joined: Thu 16 Sep 2021 03:19

NLS_LANG not taken from selected Oracle_Home

Post by HarleighMaguire » Thu 16 Sep 2021 03:22

Hi,

we are using dotConnect Universal with Oracle.

Lets assume this: Two Oracle clients installed on a machine "A" and "B".
"A" is the first in the Path

Aplication should use "B" so we add "Oracle_Home = B" to the connection string.
This works perfecly fine, its taking the OCI.dll from the "B" client 192.168.1.1.

But we have the impression that ist not taking the NLS_Lang setting from the "B" client, but uses the "A" client for that.
Could you please confirm that you not only using the OCI.dll but also all the settings from this special Oracle:home and not taking any defaults from the first client in the path ?

In one of the posts you suggested below:
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= 'AMERICAN';"

Do you have an example on the usage of this. We are using below lines of code to connect to oracle using UniConnection.
using (UniConnection testConnection = new UniConnection(connectionString))
{
try
{
testConnection.Open();
testConnection.Close();
}
}
Last edited by HarleighMaguire on Wed 29 Sep 2021 21:54, edited 1 time in total.

DmitryGm
Devart Team
Posts: 152
Joined: Fri 11 Dec 2020 10:27

Re: NLS_LANG not taken from selected Oracle_Home

Post by DmitryGm » Mon 20 Sep 2021 11:31

HarleighMaguire wrote: Thu 16 Sep 2021 03:22 But we have the impression that ist not taking the NLS_Lang setting from the "B" client, but uses the "A" client for that.
Please give an example of how this is manifested?
HarleighMaguire wrote: Thu 16 Sep 2021 03:22Do you have an example on the usage of this.
You should include this expression directly in the connection line like this:

Code: Select all

            
connectionString += ";Run Once Command=ALTER SESSION SET NLS_LANGUAGE= 'AMERICAN';";
using (UniConnection testConnection = new UniConnection(connectionString))
       {
                try
                {
                    testConnection.Open();
                    testConnection.Close();
                } catch
                {
                }
         }

Post Reply