URL_PORT
Description
URL_PORT
is a row function that returns the port portion of a URL string.Syntax
URL_PORT
(URL_string
)Return Value
Returns the port portion of a URL as an
INTEGER
value. If the URL does not specify a port, then returns -1
. If the input string is not a valid URL, returns NULL
. For example, in the string
http://localhost:8001
, the port portion is 8001
. Input Parameters
- URL_string
- Required. A field or expression that returns aTEXTvalue in URI (uniform resource identifier) format of:.protocol:authority[/path][?query][#fragment]
- The authority portion of the URL contains the host information, which can be specified as a domain name (www.workday.com), a host name (localhost), or an IP address (127.0.0.1). The host information can be followed by an optional port number preceded by a colon (for example,localhost:8001).
Examples
Return the port portion of URL string values in the
referrer
field:URL_PORT([referrer])
Return the port portion of a literal URL string:
URL_PORT("http://user:password@mycompany.com:8012/mypage.html")
returns 8012
.