- Categories:
TO_ IPADDRESS¶
Converts the input expression to an IPADDRESS value.
See also:
Syntax¶
Arguments¶
string_exprA string expression that contains a valid IPv4 or IPv6 address.
Returns¶
The return type is IPADDRESS.
For NULL input, the output is NULL.
If the input isn’t a valid IP address, the function raises an error.
Usage notes¶
- For the accepted input formats and the canonical output form, see Accepted input and canonical output.
Examples¶
The following example converts a string to an IPADDRESS value:
The following example converts an IPv6 address that contains leading zeros and returns its RFC 5952 canonical form: