Hi,
I'm trying to set NLS_LANG from code before logging on to the database, but keep running into some very odd issues.
There are two sequences of code that I've tried:
SetEnvironmentVariable('NLS_LANG', PChar('.' + VALID_CHARSETS[g_nCharSet][0]));
p_oraSession.Logon;
SetEnvironmentVariable('NLS_LANG', '.EL8MSWIN1253');
p_oraSession.Logon;
In the first sequence, VALID_CHARSETS is a constant two-dimensional array of string, and g_nCharSet is fetched from an INI file. In the second sequence, the specific value that is retrieved using the VALID_CHARSETS array is set as a literal. I am one hundred procent sure the argument in both sequences is the same (verified with logging and if structures), without any whitespace.
The second sequence works to fetch data as greek, the first doesn't. No other changes are in my code. If I fetch the value using GetEnvironmentVariable before I call Logon in both cases ".EL8MSWIN1253" is returned.
Any ideas on what may be causing this?
Thank you.