LENGTH(a) is an arithmetic function that specifies the number of characters or bytes that are required to represent the expression a internally. The function can be applied to all data types (including LOB).
a |
Result of the LENGTH(a) function |
---|---|
a is a value of data type CHAR | VARCHAR <ASCII|UNICODE> with n characters |
Number of characters n |
a is a value of a different data type of length n |
Length n in Bytes |
a is a NULL value |
NULL value |
a is a special NULL value |
Special NULL value |
The number of characters or the length in bytes is determined without taking into account any trailing blank characters (code attribute ASCII, UNICODE) or binary zeros (code attribute BYTE).
SQL Tutorial, Information About Character Strings