Link Search Menu Expand Document

URL_ENCODE

Encodes all characters that are not unreserved using percent-encoding.

Unreserved characters are defined according to W3C RFC 3986.

unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"

Syntax

URL_ENCODE(<expression>)

Parameters

Parameter Description Supported input types
<expression> The string to be encoded. TEXT

Return Type

TEXT

Example

This example below uses the function converts not unreserved characters that appear in the parameter section of the URL

SELECT CONCAT('https://www.firebolt.io/?', URL_ENCODE('example_id=1&hl=en'));

Returns: https://www.firebolt.io/?example_id%3D1%26hl%3Den