Page 1 of 1

ClientCodePage of ZConnection can NOT bet set for Oracle-DB

Posted: 03.06.2010, 16:05
by agalu58
Hello
i'am using Zeos 6.6.6 stable on Windows XP and a Oracle 10g XE Database.
I have big Problem with the German Umlaut (öäü).
On the DB i have NLS_CHARACTERSET = WE8MSWIN1252

On my Client i have Windows Codepage 1252 or 850 and i have
set all differnt NLS_LANG System-Var (NLS_LANG=GERMAN_SWITZERLAND.WE8MSWIN1252 for Ex.)

If i enter "ö" in a TDBGrid which is connectet via TZConnection then
i get chr(195), chr(182) in the DB. If i look at this via sqlplus or via Toad
i have no Way to get the "ö" again.

In the Sourcecode of Zeos i have fount on Line 407 of ZDbcOracle the
following:
(*
{ Sets a client codepage. }
if FClientCodePage <> '' then
begin
SQL := PChar(Format('SET CHARACTER SET %s', [FClientCodePage]));
FPlainDriver.ExecQuery(FHandle, SQL);
CheckOracleError(FPlainDriver, FHandle, lcExecute, SQL);
DriverManager.LogMessage(lcExecute, FPlainDriver.GetProtocol, SQL);
end;
*)

This seems to set the Character Set but it is commented out, so it does
nothing.
Can anyone help me.
Thanks a lot
André

Problem solved

Posted: 04.06.2010, 13:30
by agalu58
Hello
i have found a way to get the Umlaut (öäü) correct.
It was a mismatch beween the DB und Client (as always).
On the DB i have Charaterset WE8MSWIN1252
and on the Clientside i had to set the following:
For Lazarus und Zeos i had to set in the Registry
HKEY_LOCAL_MACHINES\SOFTWARE\ORACLE\KEY_XEClient
in NLS_LANG the value AMERICAN_SWITZERLAND.UTF8

and for sqlplus i had to set as Systemvariable
NLS_LANG=AMERICAN_SWITZERLAND.WE8PC850

after these changes, both (sqlplus and Lazarus with Zeos) worked fine.

Thanks anway and all the best.
André