Oracle ODBC: why national characters are changed to Latin equivalent as a result of SELECT

I have an Oracle 11 database that I connect to using both JDBC and ODBC. JDBC works well, but in ODBC all Polish letters in the results SELECTchange to Latin, for example ąa, ÓO, etc. I tested it with my application and just Python, which uses a module odbc. The same value from the database is returned as:

ZAMOŚĆ - by JDBC
ZAMOSC - by ODBC

My environment:

Database Server: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production

Client machine:

  • Windows Server 2008 R2 64 bit
  • 32-bit and 64-bit Oracle clients: c:\Oracle\Ora1120_32bitandc:\Oracle\Ora1120_64bit
  • The ODBC manager reports the version of the Oracle driver as: 11.02.00.01

I think that all locales are installed in Poland / Poland, but they are not visible by the command line utility SET.

Does anyone know what ODBC or the environment defines for translating Polish letters to Latin equivalents?

+3
source share
1 answer

I suspect that the client character set value is not the same in both cases. You can check the value of the NLS_LANG parameter:

  • since you are on Windows, it must be installed in the registry (perhaps HKEY_LOCAL_MACHINE → SOFTWARE → ORACLE → YOUR_HOME → NLS_LANG)
  • You find that this does not solve your problem, however adding the NLS_LANG environment variable really worked!
+4
source

Source: https://habr.com/ru/post/1791168/


All Articles