Length functions
Use length functions to determine the length of a character column, string, or variable, or of the value returned by a character expression, or (for CHAR_LENGTH in multibyte locales) the number of logical characters.
Element | Description | Restrictions | Syntax |
---|---|---|---|
column | Name of a column in table | Must have a character data type | Identifier |
table | Name of the table in which the specified column occurs | Must exist | Identifier |
variable | Host variable or SPL variable that contains a character string | Must have a character data type | See language-specific rules for names. |
Each of these functions has a distinct purpose:
- LENGTH (also known as LEN)
- OCTET_LENGTH
- CHAR_LENGTH (also known as CHARACTER_LENGTH)