ULENGTH

ULENGTH returns a FIXED BINARY(31) value that is the number of UTF characters held in a string.

Read syntax diagramSkip visual syntax diagramULENGTH( x)
x
Expression. x must have CHARACTER or WIDECHAR type.

If x has CHARACTER type, then the string must contain valid UTF-8 data. If not, the program is in error.

If x has WIDECHAR type, then the string must contain valid UTF-16 data. If not, the program is in error.

ULENGTH will return the number of UTF-8 or UTF-16 characters held in the CHAR or WIDECHAR argument, respectively. It does not return the number of characters if the string were normalized. For example, in UTF-8, a lowercase a umlaut may be represented in the normalized or canonical form via the string 'c3_a4'x or in the unnormalized or combining form as '61_cc_88'x, but ULENGTH will return 1 for the string 'c3_a4'x and 2 for the string '61_cc_88'x.