National chars in SQL Statement dont works

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
M.Schmidt-E.
Posts: 15
Joined: Fri 30 Jan 2009 11:04

National chars in SQL Statement dont works

Post by M.Schmidt-E. » Fri 04 Dec 2009 08:07

Hello,
i use ODAC 6.70.0.42 and Delphi 2009 with Oracle 10G Database.
Both (client and DB Server) NLS is AL32UTF and oraSession options use Unicode is set to true. The charset property of oraSession is empty.

if i build a tsmartquery with sql:='Select * from anyTable where anyColum='Prüfung' ==>the resultset is empty but data are exists. The problem are the germans umlaut like ÖÄÜ,öäü etc.
what is wrong?
thanks
Mathias

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 04 Dec 2009 08:56

The value of the SQL property is passed to Oracle as AnsiString in the WIN1252 encoding. So you should set the character set in NLS_LANG on the client to WE8MSWIN1252.

You can also use Unicode OCI environment. In this case the value of the SQL property is passed to Oracle as UnicodeString. To enable Unicode environment, set the OCIUnicode global variable from the OraCall unit to True in the initialization section of one of your program units.

M.Schmidt-E.
Posts: 15
Joined: Fri 30 Jan 2009 11:04

Post by M.Schmidt-E. » Fri 04 Dec 2009 11:52

It works!
many thanks.
Mathias

Post Reply