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

The example below converts characters that are not unreserved 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