Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

SQL Reference

Functions

Syntax

Example

 

SQL Reference

Joins

Nested Queries

Set Operations

ON CURSOR | INSTANCE

WITH Options

Commands

Functions

 

CHARACTER_LENGTH | CHAR_LENGTH

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 (string)

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

 

Example

select company, city,
char_length (city)
from customers
where state = 'co'

OR

select company, contact,
character_length ("Denver")
from customers
where state = 'co'

Top