LENGTH()

All functions > STRING > LENGTH()

Returns the number of characters in a string.

Signatures

Returns: Number of characters in the string

LENGTH(string: VARCHAR) → BIGINT
sql
ParameterTypeRequiredDescription
stringVARCHARYesInput string to measure

Notes

  • Counts every character position in the string—letters, digits, spaces, symbols, and emoji each add one
  • LENGTH('') is 0; if the input is NULL the result is NULL (use NULL(VARCHAR); bare NULL fails inference)
  • Aliases: LEN, SIZE (same function)

Aliases

  • LEN

  • SIZE

Examples

FeatureQL
SELECT
    -- Basic string length
    f1 := LENGTH('Hello World'),
    -- Short string
    f2 := LENGTH('ABC'),
    -- Spaces are counted
    f3 := LENGTH('  spaces  '),
    -- Emoji characters
    f4 := LENGTH('😀😁'),
    -- Euro symbol counts as 1
    f5 := LENGTH('€100'),
    -- Using alias LEN
    f6 := LENGTH('test'),
    -- Using alias SIZE
    f7 := LENGTH('x'),
    -- NULL string yields NULL
    f8 := LENGTH(NULL(VARCHAR))
;
Result
f1 BIGINTf2 BIGINTf3 BIGINTf4 BIGINTf5 BIGINTf6 BIGINTf7 BIGINTf8 BIGINT
113102441NULL

Last update at: 2026/06/20 10:08:10