length

Returns the length in characters of a char or varchar expression, or number of strings/items in other types. The syntax is

length(value[, mode])

For example:

SELECT  NAME, length(NAME)
     FROM    SYSTABLES

The results are:

NAME                length(NAME)
 SYSTABLES               9
 SYSCOLUMNS             10
 SYSINDEX                8
 SYSUSERS                8
 SYSPERMS                8
 SYSTRIG                 7
 SYSMETAINDEX           12

The optional mode argument is a stringcomparemode-style compare mode to use; see the Vortex manual on <apicp stringcomparemode> for details on syntax and the default. If mode is not given, the current apicp stringcomparemode is used. Currently the only pertinent mode flag is "iso-8859-1", which determines whether to interpret value as ISO-8859-1 or UTF-8. This can alter how many characters long the string appears to be, as UTF-8 characters are variable-byte-sized, whereas ISO-8859-1 characters are always mono-byte. The mode argument was added in version 6.

In version 5.01.1226622000 20081113 and later, if given a strlst type value, length() returns the number of string values in the list. For other types, it returns the number of values, e.g. for varint it returns the number of integer values.


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.