UNICODE and SQL 

UNICODE can be used for metadata, user data and in SQL statements if installation of a UNICODE-enabled database has been carried out.

UNICODE for metadata

If the database is UNICODE-enabled, all columns in the system tables that can be used to request the metadata have a data type with the code attribute UNICODE.

UNICODE for user data

To make user data UNICODE-enabled, you must set the UNICODE code attribute in a UNICODE-enabled database for the required user data. The UNICODE code attribute can be used for the data types CHAR[ACTER] (n), VARCHAR (n) and LONG[VARCHAR]:

 

Example 1 illustrates the definition of Java class TableDef. Java class TableDef can be used to display the results of various column definitions.

Displaying the Column Definition of a Table

java TableDef <jdbcurl> <table_name>

Creating a temporary table using the determined column definitions, and displaying these column definitions

<command> ::= java TableDef <jdbcurl> <table_name> <column_definition>

<jdbcurl> ::= jdbc:sapdb:<database_name>?user=<userid>&password=<password>

java TableDef jdbc:sapdb:TST?user=TEST&password=TEST DUMMY a varchar (20)

TABLE: DUMMY
A: VARCHARASCII (20)

UNICODE in SQL Statements

SQL statements can contain both UNICODE literals and UNICODE identifiers. The prerequisite for implementing these SQL statements is a UNICODE-enabled client (C/C++-Precompiler, JDBC, ODBC, SQL Studio or Web SQL).

The prerequisite for using UNICODE in the SQL Studio and Web SQL is that a UNICODE-enabled ODBC has been installed. SQL Studio and Web SQL are used on the operating systems NT/Windows 2000. These operating systems support UNICODE.