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.

(1)
Length Functions

1 1
2.1 LENGTH
2.1 LEN
2.1 CHAR_LENGTH
2.1 CHARACTER_LENGTH
1 OCTET_LENGTH
2  (
3.1  %Quoted String2
3.1 34 variable_name
3.1 ?  table. column
2 )
Notes:
  • 1 HCL OneDB™ extension
  • 2 See Quoted String
  • 3 ESQL/C
  • 4 SPL Language
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)