Result Type - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantage™

For all server character sets except KANJI1, CHARACTER_LENGTH returns the length of string_expression in characters.

If the string_expression argument is null, the result is null.

For KANJI1, the following results are obtained.

FOR this client character set … CHARACTER_LENGTH returns …
KanjiEBCDIC the length of string_expression as the number of bytes.

A mix of single and multibyte characters is expected.

If any Shift-Out/Shift-In characters are present, they are included in the result count.

KanjiEUC

KanjiShift-JIS

the length of string_expression as the number of logical characters, based on the client session character set.

A mix of single and multibyte characters is expected.

ASCII

EBCDIC

the length of string_expression as the number of bytes.

KANJI1 support is deprecated. KANJI1 is not allowed as a default character set; the system changes the KANJI1 default character set to the UNICODE character set. Creation of new KANJI1 objects is highly restricted. Although many KANJI1 queries and applications may continue to operate, sites using KANJI1 should convert to another character set as soon as possible. For more information, see KANJI1 Character Set in Teradata Vantage™ - Advanced SQL Engine International Character Set Support, B035-1125.

Because trailing pad characters are considered characters, the length of the value in a CHARACTER column is always equal to the length defined for the column.

The length of the value in a VARCHAR or CLOB column is always equal to the number of characters, including any trailing pad characters, contained in that value.