TO_IPV6_OR_NULL
Descriptionβ
Convert a string form of IPv6 address to IPv6 type.
Syntaxβ
TO_IPV6_OR_NULL(<ipv6_str>)
Parametersβ
Parameter | Description |
---|---|
<ipv6_str> | An IPv6 address of type String |
Return Valueβ
Returns value of IPv6 type.
- If the IPv6 address has an invalid format, returns NULL.
Exampleβ
SELECT to_ipv6_or_null('.'), to_ipv6_or_null('2001:1b70:a1:610::b102:2');
+----------------------+---------------------------------------------+
| to_ipv6_or_null('.') | to_ipv6_or_null('2001:1b70:a1:610::b102:2') |
+----------------------+---------------------------------------------+
| NULL | 2001:1b70:a1:610::b102:2 |
+----------------------+---------------------------------------------+