tencent cloud

피드백

URL Function

마지막 업데이트 시간:2024-03-20 11:47:49
    This document introduces the basic syntax and examples of URL functions.

    Syntax Format

    URL functions can extract fields from standard HTTP URLs. The following is an example of a standard URL:
    [protocol:][//host[:port]][path][?query][#fragment]
    Note:
    The extracted fields do not include URL delimiters : and ?.

    Common URL Functions

    Function
    Description
    Example
    Output
    url_extract_fragment(url)
    Extracts fragment from the URL. The result is of the varchar type.
    * | select url_extract_fragment('https://console.tencentcloud.com/#/project/dashboard-demo/categoryList')
    /project/dashboard-demo/categoryList
    url_extract_host(url)
    Extracts host from the URL. The result is of the varchar type.
    * | select url_extract_host('https://console.tencentcloud.com/cls')
    console.cloud.tencent.com
    url_extract_parameter(url, name)
    Extracts the value of query from the URL. The result is of the varchar type.
    * | select url_extract_parameter('https://console.tencentcloud.com/cls?region=ap-chongqing','region')
    ap-chongqing
    url_extract_path(url)
    Extracts path from the URL. The result is of the varchar type.
    * | select url_extract_path('https://console.tencentcloud.com/cls?region=ap-chongqing')
    /cls
    url_extract_port(url)
    Extracts port from the URL. The result is of the bigint type.
    * | select url_extract_port('https://console.tencentcloud.com:80/cls?region=ap-chongqing')
    80
    url_extract_protocol(url)
    Extracts protocol from the URL. The result is of the varchar type.
    * | select url_extract_protocol('https://console.tencentcloud.com:80/cls?region=ap-chongqing')
    https
    url_extract_query(url)
    Extracts the key of query from the URL. The result is of the varchar type.
    * | select url_extract_query('https://console.tencentcloud.com:80/cls?region=ap-chongqing')
    region=ap-chongqing
    url_encode(value)
    Escapes value so that it can be used in URL_query.
    Letters will not be decoded.
    .-*_ will not be encoded.
    Spaces are decoded as +.
    Other characters are decoded into the UTF-8 format.
    * | select url_encode('https://console.tencentcloud.com:80/cls?region=ap-chongqing')
    https%3A%2F%2Fconsole.cloud.tencent.com%3A80%2Fcls%3Fregion%3Dap-chongqing
    url_decode(value)
    Decodes the URL.
    * | select url_decode('https%3A%2F%2Fconsole.cloud.tencent.com%3A80%2Fcls%3Fregion%3Dap-chongqing')
    https://console.tencentcloud.com:80/cls?region=ap-chongqing
    
    문의하기

    고객의 업무에 전용 서비스를 제공해드립니다.

    기술 지원

    더 많은 도움이 필요하시면, 티켓을 통해 연락 바랍니다. 티켓 서비스는 연중무휴 24시간 제공됩니다.

    연중무휴 24시간 전화 지원