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.

(explicit id lefu001) lefu001 (explicit id lefu002) lefu002 (explicit id lefu003) lefu003 (explicit id lefu004) lefu004

Length Functions

[]
{ { LENGTH | LEN } | { CHAR_LENGTH | CHARACTER_LENGTH } | OCTET_LENGTH }
( { <Quoted String>[] | [][] variable_name | [ table. ] column } )
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)
1 Informix® extension
2 ESQL/C
3 SPL Language