Result

Teradata Vantage™ SQL Functions, Expressions, and Predicates

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

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.

In accordance with Teradata internationalization plans, KANJI1 support is deprecated and is to be discontinued in the near future. 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™ NewSQL 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.