CHAR_LENGTH / CHARACTER_LENGTH

<< Click to Display Table of Contents >>

Navigation:  Streaming SQL Reference Guide > Basic Building Blocks > Functions > Scalar Functions >

CHAR_LENGTH / CHARACTER_LENGTH

Previous pageReturn to chapter overviewNext page

Syntax for these functions is as follows:

CHAR_LENGTH | CHARACTER_LENGTH ( <character-expression> )

 

Returns the length in characters of the string passed as the input argument. Returns null if input argument is null.

Examples

CHAR_LENGTH('one')

3

CHAR_LENGTH('')

0

CHARACTER_LENGTH('fred')

4

CHARACTER_LENGTH( cast (null as varchar(16) )

null

CHARACTER_LENGTH( cast ('fred' as char(16) )

16

Limitations

Note: SQLstream streaming SQL does not support the optional USING CHARACTERS | OCTETS clause. This is a departure from the SQL:2008 standard.