在 VSCode 中执行
isql
时,我看到以下错误:
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.
直接从cmd.exe执行时效果很好。只有当我在bat文件中运行它时才会产生错误。
主目录和
locales.dat
文件都很好,LANG当前设置为en_US.UTF-8
。
有人遇到同样的问题吗?
顺便说一句,我无法使用管理员权限。
错误信息表明某些环境变量尚未加载。
虽然安装程序更新了您的 Windows 环境变量,以便您从
isql
运行 cmd.exe
时不会出现任何问题,但我猜测 .bat
文件无法访问 Windows 环境变量(我对 Windows 真的很生疏) .bat
行为,因此目前这只是猜测)。
在 linux/unix 环境中,所有脚本和程序都需要首先加载 Sybase 特定的环境变量,这是通过获取
$SYBASE/SYBASE.sh
文件来执行的。
在 Windows
.bat
脚本中,您应该能够通过运行 %SYBASE%\SYBASE.bat
文件来加载 Sybase 特定的环境变量。