Reference Guide > TDV Support for SQL Functions > Character Functions > PARSE_URL
 
PARSE_URL
Returns the specified part from the URL. Valid values for partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and USERINFO. For example, parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'HOST') returns 'facebook.com'. Also a value of a particular key in QUERY can be extracted by providing the key as the third argument, for example, parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'QUERY', 'k1') returns 'v1'.
Syntax
parse_url(string urlString, string partToExtract [, string keyToExtract])
Example
parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'HOST')