CHARACTER_LENGTH(string_exp)

Returns the length in characters of the string expression if the string expression is of a Character data type; otherwise, returns the length in bytes of the string expression.

 

Example:

SELECT CHARACTER_LENGTH('ABCDEFG') returns 7 (length of string expression)