Background documentation UNICODE and SQL Locate the document in its SAP Library structure

UNICODE can be used for metadata, application 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 Structure linkcode attribute UNICODE.

UNICODE for Application Data

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

·        CHAR[ACTER] (n) UNICODE

·        VARCHAR (n) UNICODE

·        LONG[VARCHAR] UNICODE

 

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=<user_name>&password=<password>

Example

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 Studio).

The prerequisite for using UNICODE in the SQL Studio and Web SQL Studio is that a UNICODE-enabled ODBC has been installed. SQL Studio and Web SQL Studio are used on the operating system Windows 2000. This operating system supports UNICODE.