CHAR_LENGTH function in Amazon QLDB - Amazon Quantum Ledger Database (Amazon QLDB)

CHAR_LENGTH function in Amazon QLDB

Important

End of support notice: Existing customers will be able to use Amazon QLDB until end of support on 07/31/2025. For more details, see Migrate an Amazon QLDB Ledger to Amazon Aurora PostgreSQL.

In Amazon QLDB, use the CHAR_LENGTH function to return the number of characters in the specified string, where character is defined as a single unicode code point.

Syntax

CHAR_LENGTH ( string )

CHAR_LENGTH is a synonym of CHARACTER_LENGTH function in Amazon QLDB.

Arguments

string

The field name or expression of data type string that the function evaluates.

Return type

int

Examples

SELECT CHAR_LENGTH('') FROM << 0 >> -- 0 SELECT CHAR_LENGTH('abcdefg') FROM << 0 >> -- 7 SELECT CHAR_LENGTH('eࠫ') FROM << 0 >> -- 2 (because 'eࠫ' is two code points: the letter 'e' and combining character U+032B)

Related functions