Unicode support was introduced in Sybase ASE version 12.5. A number of improvements to Unicode support were implemented in Sybase ASE 12.5.1. For more on this, see http://www.sybase.com/detail?id=1026310
In order to use Unicode in your database, you need to
You should ask your SAP ASE DBA for both of these tasks.
In order to use Unicode literals in AQT, you need to specify that your SAP ASE client uses Unicode encoding. This done by setting the following environment variable:
Variable |
LC_ALL |
Value |
en_US.utf8 |
This is done through the Windows Control Panel > Advanced > Environment Variables.
Unicode strings are held in columns with the following data types: unichar, univarchar.
The use of Unicode literals in your SQL statements is supported in SAP ASE 12.5.1 (and later), but not in SAP ASE 12.5.0. If you are running SAP ASE 12.5.0 you can use Unicode literals in your SQL by selecting Options > Unicode Options > For Sybase, use TO_UNICHAR for Unicode strings. When this is option is checked, AQT will scan all SQL being processed; if it finds any unicode string values, it will replace them with to_unichar functions.
Example:
if you run the following from the SQL window:
Select * from dbo.unicode_test where col1 ='ald'
AQT will actually run:
Select * from dbo.unicode_test where col1 = to_unichar(945) || to_unichar(955) || to_unichar(948)
This makes it very easy to use unicode literals in a SAP ASE database.
These comments are for SAP ASE 12.5.0.