Previous Topic

Next Topic

Book Contents

Book Index

Unicode support with Sybase

Version

Unicode support was introduced in Sybase version 12.5. A number of improvements to Unicode support were implemented in Sybase 12.5.1. For more on this, see http://www.sybase.com/detail?id=1026310

Configuring the Sybase Server

In order to use Unicode in your database, you need to

You should ask your Sybase DBA for both of these tasks.

Configuring the Sybase Client

In order to use Unicode literals in AQT, you need to specify that your Sybase 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.

Data Types

Unicode strings are held in columns with the following data types: unichar, univarchar.

Running SQL Statements with Unicode literals

The use of Unicode literals in your SQL statements is supported in Sybase 12.5.1, but not in Sybase 12.5.0. If you are running Sybase 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 Sybase 12.5.0 database.

Other comments

These comments are for Sybase 12.5.0.

Advanced Query Tool
https://www.querytool.com
© 2023 Cardett Associates Ltd. All rights reserved.