DRAFT

Omnidex SQL Function: CHARACTER_LENGTH

Description

The CHARACTER_LENGTH and CHAR_LENGTH functions return the number of characters in a string. The number returned is a 4-byte integer.

CHARACTER_LENGTH and CHAR_LENGTH should not be confused with $COL_LEN and $COLUMN_LENGTH which return the length of the column as it is defined in the environment catalog.

CHARACTER_LENGTH and CHAR_LENGTH are the same function. Both are supported for flexibility.

Syntax

CHAR[ACTER]_LENGTH ( [column_spec | “string”] )

column_spec

Required. Any column contained in the FROM clause. This can be a literal or data from a column.

"strng"

Required. Any string. This can be a literal or data from a column.

Examples

Example 1: Column

SELECT company, city,
CHAR_LENGTH (city) 
FROM customers 
WHERE state = 'co'

Example 2: Quoted String

SELECT company, contact,
CHARACTER_LENGTH ("Denver")
FROM customers
WHERE state = 'co'
 
Back to top
dev/sql/functions/character_length/home.txt · Last modified: 2012/10/26 14:28 (external edit)