Print Thread
OCIDLL with instant client returns incorrect characters
#65180 12/08/23 05:57 AM
Joined: Dec 2019
Posts: 9
C
CAR Offline OP
Member
OP Offline
Member
C
Joined: Dec 2019
Posts: 9
I encountered a problem using the OCIDLL variable with Oracle instant clients.
Some special characters were converted to ? Appears to be characters above asci 128.

Simple test case:

SQL: select ' SEI’s (“SEI”) ' spclchar from dual

Result: SEI?s (?SEI?)

Delphi 11.3
DOA 4.14
Oracle DB 19.19
Oracle Instant Client 19.3 64 bit. I tried Instant client 21.3. Same result.

The variable method returns the correct results when using a full oracle client install. The OracleHomeName is auto populated in this case.

Am I missing another setting using the OCIDLL method?

Last edited by CAR; 12/08/23 06:23 AM.
Re: OCIDLL with instant client returns incorrect characters
CAR #65181 12/08/23 09:14 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
Can you check the NLS_LANG environment variable? Can you set it to the same value as the NLS_LANG key of the full Oracle Client? For the full Oracle Client you can find it in the registry at HKEY_LOCAL_MACHINE\Software\Oracle\Key_<HomeName>\NLS_LANG.


Marco Kalter
Allround Automations
Re: OCIDLL with instant client returns incorrect characters
CAR #65184 12/08/23 02:25 PM
Joined: Dec 2019
Posts: 9
C
CAR Offline OP
Member
OP Offline
Member
C
Joined: Dec 2019
Posts: 9
The NLS_LANG variable is empty and cannot be assigned in the delphi code. I tried setting a NLS_LANG environment variable to the same value as found in the registry key for the full client. NLS_LANG variable was still blank.

The goal is to fully setup the OCI information in the delphi code without any environment or registry settings to make deployment easy.

Re: OCIDLL with instant client returns incorrect characters
CAR #65188 12/11/23 09:43 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
You can set the NLS_LANG environment variable in your code, before the first connection is made to the database. Note that the variable value is local to your application and subprocesses. It will not affect the NLS_LANG value in Windows or in parent processes.


Marco Kalter
Allround Automations
Re: OCIDLL with instant client returns incorrect characters
CAR #65189 12/11/23 03:17 PM
Joined: Dec 2019
Posts: 9
C
CAR Offline OP
Member
OP Offline
Member
C
Joined: Dec 2019
Posts: 9
Thank you Marco. I am puzzled as to why my initial test with setting NLS_LANG env didn't seem to work.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.086s Queries: 14 (0.025s) Memory: 2.5142 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-04-29 05:29:26 UTC
Valid HTML 5 and Valid CSS