8.3.4. CHAR_LENGTH()
, CHARACTER_LENGTH()
Available in
DSQL, PSQL
Syntax
CHAR_LENGTH (string)
| CHARACTER_LENGTH (string)
Parameter | Description |
---|---|
string | An expression of a string type |
Result type
INTEGER
Description
Gives the length in characters of the input string.
Notes
|
Examples
select char_length('Hello!') from rdb$database
-- returns 6
select char_length(_iso8859_1 'Grüß di!') from rdb$database
-- returns 8
select char_length
(cast (_iso8859_1 'Grüß di!' as varchar(24) character set utf8))
from rdb$database
-- returns 8; the fact that ü and ß take up two bytes each is irrelevant
select char_length
(cast (_iso8859_1 'Grüß di!' as char(24) character set utf8))
from rdb$database
-- returns 24: all 24 CHAR positions count
See also