Versions available for this page: CUBRID 8.2.1 | CUBRID 8.3.0 | CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 | CUBRID 8.4.3 | CUBRID 9.0.0 |
The CHAR_LENGTH function returns the number of characters in a character string. It is used to calculate the length of a CHAR, NCHAR, VARCHAR or VARNCHAR (and the synonym of such data type) string.
CHAR_LENGTH ( length_operand )
length_operand :
character string
NULL
The following is an example that returns countries whose names consist of 15 - 16 characters from the nation table.
SELECT CHAR_LENGTH(name), name
FROM nation
WHERE CHAR_LENGTH(name) BETWEEN 15 AND 16
ORDER BY 1 ASC;
Result :
15 'Solomon Islands'
16 'Papua-New Guinea'