0

I have tow Oracle 6i - Patch 17 applications running on the same host. Befoe they used to run on two different Windows installation for each one; but this is not conveniant.

Each application is developed by a different company.

I managed to install Oracle 6i client on Windows 11 64 bit.

Both applications work perfectly except when it comes to NLS_LANG variable.

The first application has its own server. SERVER-1 and the second application has its own server SERVER-2.

The oracle database on SERVER-1 USES NLS_LANG=ARABIC_UNITED ARAB EMIRATES.AR8MSWIN1256

The oracle database on SERVER-2 USES NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1

I created a batch file to set NLS_LANG for each Oracle Client application; and they user need to run the patch then run the application.

This is the Batch1.bat for Application1 for SERVER-1

NET STOP OracleClientCache80 'Stop Oracle service if runninig 
SETX NLS_LANG "ARABIC_UNITED ARAB EMIRATES.AR8MSWIN1256"
SETX NLS_LANG "ARABIC_UNITED ARAB EMIRATES.AR8MSWIN1256" -M
NET START OracleClientCache80 ' Start Oracle service to adapt NLS_LANG changes

This is the Batch2.bat for Application2 for SERVER-2

NET STOP OracleClientCache80
SETX NLS_LANG "AMERICAN_AMERICA.WE8ISO8859P1"
SETX NLS_LANG "AMERICAN_AMERICA.WE8ISO8859P1" -M
NET START OracleClientCache80

This what works perfectly but not what I really want:

I run Batch1.bat then log-off Windows and log-in again --> all perfect. I run Batch2.bat then log-off Windows and log-in again --> all perfect.

But if I didn't log-off/log-in I got weired charachters in the report preview while trying to print it.

As attached:

Strange Charset Encoding

If I DID log-out/log-in; I don't face any issue with charachter encoding and NLS_LANG.

Is there a way to force to refresh NLS_LANG added by the batch to Windows Variables and avoid log-off/log-in?

This is my main question and goal!

I found many refrences for this but none of them worked out for me!

Some suggested to restart exploere.exe and others suggested using external library like Chocolatey

What would be the perfect senario please?

Thank you

Guru
  • 42
  • 7
  • `setx` sets the value of the variable for all **future** `cmd` instances, not for any instances that have already been established **including the current instance**. use `set "NLS_LANG=whateverstingisappropriate"` – Magoo Aug 08 '22 at 04:25
  • @Magoo Thank you for your suggestion; but it didn't work...It gives ????? for reports preview for SERVER-2 and I am forced to log-out/log-in to make it work! Any idea please? Thanks alot – Guru Aug 08 '22 at 09:22
  • Perhaps you should use `/M` in place of `-M`. `/` is used for most switches in Windows; `-` is sometimes used for utilities ported from other systems. – Magoo Aug 08 '22 at 17:55

0 Answers0