URL Functions
This section describes URL functions, including their syntax, parameters, and usage examples.
Function List
Function |
Description |
---|---|
Encodes a URL. |
|
Decodes a URL. |
|
Extracts the fragment information from a URL. |
|
Extracts the host information from a URL. |
|
Extracts the parameter information from a URL. |
|
Extracts the path information from a URL. |
|
Extracts the port information from a URL. |
|
Extracts the protocol information from a URL. |
|
Extracts the query information from a URL. |
url_encode
This function encodes a URL.
Syntax: url_encode(expr)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
Return value type: string
Example: SELECT URL_ENCODE('http://username:password@host:8080/index?parameterName=parameterValue#fragment')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_ENCODE('http://username:password@host:8080/index?parameterName=parameterValue#fragment') |
http%3A%2F%2Fusername%3Apassword%40host%3A8080%2Findex%3FparameterName%3DparameterValue%23fragment |
url_decode
This function decodes a URL.
Syntax: url_decode(expr)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
Return value type: string
Example: SELECT URL_DECODE('http%3A%2F%2Fusername%3Apassword%40host%3A8080%2Findex%3FparameterName%3DparameterValue%23fragment')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_DECODE('http%3A%2F%2Fusername%3Apassword%40host%3A8080%2Findex%3FparameterName%3DparameterValue%23fragment') |
http://username:password@host:8080/index?parameterName=parameterValue#fragment |
url_extract_fragment
This function extracts the fragment information from a URL.
Syntax: url_extract_fragment(expr)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
Return value type: string
Example: SELECT URL_EXTRACT_FRAGMENT('http://username:password@host:8080/index?parameterName=parameterValue#fragment')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_EXTRACT_FRAGMENT('http://username:password@host:8080/index?parameterName=parameterValue#fragment') |
fragment |
url_extract_host
This function extracts the host information from a URL.
Syntax: url_extract_host(expr)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
Return value type: string
Example: SELECT URL_EXTRACT_HOST('http://username:password@host:8080/index?parameterName=parameterValue#fragment')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_EXTRACT_HOST('http://username:password@host:8080/index?parameterName=parameterValue#fragment') |
host |
url_extract_parameter
This function extracts the parameter information from a URL.
Syntax: url_extract_parameter(expr, paramName)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
paramName |
Parameter |
String |
Yes |
Return value type: string
Example: SELECT URL_EXTRACT_PARAMETER('http://username:password@host:8080/index?parameterName=parameterValue#fragment', 'parameterName')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_EXTRACT_PARAMETER('http://username:password@host:8080/index?parameterName=parameterValue#fragment', 'parameterName') |
parameterValue |
url_extract_path
This function extracts the path information from a URL.
Syntax: url_extract_path(expr)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
Return value type:
String
Example: SELECT URL_EXTRACT_PATH('http://username:password@host:8080/index?parameterName=parameterValue#fragment')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_EXTRACT_PATH('http://username:password@host:8080/index?parameterName=parameterValue#fragment') |
/index |
url_extract_port
This function extracts the port information from a URL.
Syntax: url_extract_port(expr)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
Return value type: string
Example: SELECT URL_EXTRACT_PORT('http://username:password@host:8080/index?parameterName=parameterValue#fragment')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_EXTRACT_PORT('http://username:password@host:8080/index?parameterName=parameterValue#fragment') |
8080 |
url_extract_protocol
This function extracts the protocol information from a URL.
Syntax: url_extract_protocol(expr)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
Return value type: string
Example: SELECT URL_EXTRACT_PROTOCOL('http://username:password@host:8080/index?parameterName=parameterValue#fragment')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_EXTRACT_PROTOCOL('http://username:password@host:8080/index?parameterName=parameterValue#fragment') |
http |
url_extract_query
This function extracts the query information from a URL.
Syntax: url_extract_query(expr)
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
expr |
URL string. |
String |
Yes |
Return value type: string
Example: SELECT URL_EXTRACT_QUERY('http://username:password@host:8080/index?parameterName=parameterValue#fragment')
Type |
Query Statement |
Returned Result |
---|---|---|
Scenario |
URL_EXTRACT_QUERY('http://username:password@host:8080/index?parameterName=parameterValue#fragment') |
parameterName=parameterValue |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.