Hexadecimal Representation of Object Names | SQL Fundamentals | Teradata Vantage - 17.10 - Hexadecimal Representation of Object Names - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1141-171K
Language
English (United States)

All object names are stored in the Data Dictionary in UNICODE. However, in an international environment, some client users may find that their client (session) character set cannot express an object name created on another client. In these cases, you can use a hexadecimal representation of the unavailable UNICODE characters in the object name to more easily access the object.

Using Delimiters with Hexadecimal Identifiers

When you reference a database object using a hexadecimal representation of the object name, you must express it as a name literal or enclose the name in UNICODE delimiters.

The best practice is to use UNICODE delimited identifiers because the hexadecimal value remains the same across all supported character sets, whereas using hexadecimal name literals allows the name representation to vary depending on the character set.

Example: Using UNICODE Delimited Identifiers

Consider a table name of where the translation to the UNICODE server character set is equivalent to the following Unicode delimited identifier:

U&"#FF83#FF70#FF8C#FF9E#FF99" UESCAPE '#'

From a client where the client character set is KANJIEUC_0U, you can access the table using the following hexadecimal name literal:

'80C380B080CC80DE80D9'XN

From a client where the client character set is KANJISJIS_0S, you can access the table using the following hexadecimal name literal:

'C3B0CCDED9'XN

Example: Using Hexadecimal Name Literals

Assume that a hexadecimal name literal that represents the name TAB1 using full width Latin characters from the KANJIEBCDIC5035_0I character set on a system enabled for Japanese language support:

SELECT EmployeeID FROM "0E42E342C142C242F10F"XN;

The database converts the hexadecimal name literal from a KANJI1 string to a UNICODE string to find the object name in the Data Dictionary.

Here is an example of a Unicode delimited identifier that represents the name TAB1 on a system enabled for Japanese language support:

SELECT EmployeeID FROM U&"#FF34#FF21#FF22#FF11" UESCAPE '#';