URL_ENCODE()

All functions > STRING > URL_ENCODE()

Encodes a string for safe use in URL components using percent-encoding (RFC 3986).

Signatures

Returns: Percent-encoded string

URL_ENCODE(string: VARCHAR) → VARCHAR
sql
ParameterTypeRequiredDescription
stringVARCHARYesText to encode

Notes

  • Non-reserved characters may remain unescaped; reserved and non-ASCII characters are escaped as %HH
  • Returns NULL if the input is NULL (use NULL(VARCHAR); bare NULL fails inference)
  • Pair with URL_DECODE to recover the original string

See also

Examples

FeatureQL
SELECT
    f1 := URL_ENCODE('a b'), -- Space becomes percent-encoding
    f2 := URL_ENCODE(''), -- Empty string
    f3 := URL_ENCODE(NULL(VARCHAR)) -- NULL yields NULL
;
Result
f1 VARCHARf2 VARCHARf3 VARCHAR
a%20b(empty)NULL

Last update at: 2026/05/26 17:22:09