Open 2 sessions with different nls_lang

I have 2 databases with different nls_lang's.

Code:
begin
SetEnvironmentVariable('nls_lang', 'AMERICAN_CIS.WE8ISO8859P1');
try
  OracleSession1.Connected := true;
  OracleDataSet1.Open;
finally
  SetEnvironmentVariable('nls_lang', 'UKRAINIAN_UKRAINE.CL8MSWIN1251');
end;

OracleSession2.Connected := true;
OracleDataSet2.Open;

end;
This code doesn't work correctly.
OracleSession2 opens with nls_lang=AMERICAN_CIS.WE8ISO8859P1.
 
This will indeed not work. The Oracle Client will read the environment only once. At the session level you can only use "ALTER SESSION" commands.
 
Back
Top