Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

LENGTH function (ODBC compatible)

Syntax

LENGTH ( char_expression )

Description

The scalar function LENGTH returns the number of characters in char_expression, excluding trailing blanks.

Example

SELECT name 'LONG NAME'

FROM customer

WHERE LENGTH (name) > 5 ;

Notes

  • The argument to the function must be of character type.
  • The result is of type INTEGER.
  • If the argument expression evaluates to null, the result is null.

TOCIndex