Sybase isql : An error occurred when attempting to allocate localization-related structures

113 Views Asked by At

When executing isql in VSCode, I see this error:

The context allocation routine failed when it tried to load localization files!!
One or more following problems may caused the failure
 Your sybase home directory is C:\SAP. Check the environment variable SYBASE if it is not the one you want!
Using locale name "en_US.UTF-8" defined in environment variable LANG
Locale name "en_US.UTF-8" doesn't exist in your C:\SAP\locales\locales.dat file
An error occurred when attempting to allocate localization-related structures.

It works fine when executing directly from cmd.exe. Only when I run it inside a bat file did it produce the error.

Home directory and locales.dat file are both fine, LANG is currently set at en_US.UTF-8.

Has anybody encountered the same issue?

I cant use admin right BTW.

1

There are 1 best solutions below

0
markp-fuso On

The error messages indicate that some environment variables have not been loaded.

While the installer updated your Windows environment variables such that you have no issues when running isql from cmd.exe, I'm guessing the .bat file is unable to access the Windows environment variables (I'm really rusty with Windows .bat behavior so that's just a guess at this point).

In a linux/unix environment all scripts and programs need to first load the Sybase-specific environment variables, and this is performed by sourcing the $SYBASE/SYBASE.sh file.

In a Windows .bat script you should be able to load the Sybase-specific environment variables by running the %SYBASE%\SYBASE.bat file (where in your environment it appears %SYBASE% == C:\SAP)