CHARACTER_LENGTH Function Examples | VantageCloud Lake - Examples: CHARACTER_LENGTH Function - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

The following statement applies the CHARACTER_LENGTH function to the Name column, which is type VARCHAR(30) CHARACTER SET LATIN, to get the number of characters in each employee name:

SELECT Name, CHARACTER_LENGTH(Name) 
FROM Employee; 

The result is as follows (separator blanks are considered characters):

Name      Character_Length(Name)
--------  ----------------------
Smith T            7
Newman P           8
Omura H            7
      .            .

Example Set 1: KanjiEBCDIC

Server Character Set Example Return Value
GRAPHIC ABC 3
KANJI1 De<MNP > 10
<><> 4

Set 2: KanjiShift-JIS

Server Character Set Example Return Value
KANJI1 <><> 10
D eF 3
UNICODE ABC 3
GRAPHIC ABC 3

Set 3: KanjiEUC

Server Character Set Example Return Value
KANJI1 ss3 C ss3 D 2
GRAPHIC 2
UNICODE <><> 0
dA ss2 B ss3 E 4
LATIN ABC 3