Start of change

URL_ENCODE

The URL_ENCODE scalar function completes URL encoding of the provided text using UTF-8 encoding. This is typically used to encode parameter information that is passed as part of the URL.

Read syntax diagramSkip visual syntax diagramURL_ENCODE(character-string )
character-string
An expression that returns a built-in character string that is to be encoded.

The result of the function is a varying length character string that contains character-string after being encoded.

Example

  • Create a URL that has the parameter encoded for a request to example.com.
    VALUES 'https://www.example.com/search?q=' CONCAT URL_ENCODE('IBM i Q&A') 
    Returns
    https://www.example.com/search?q=IBM+i+Q%26A
End of change