INET6_NTOA
Declaration
INET6_NTOA(expr)
Description
Converts an IPv6 or IPv4 network address in numeric format to a binary string. The string can be used as a string in the character set. If the parameter is not a valid address, NULL is returned.
INET6_NTOA() has the following properties:
-
Does not use system functions for the conversion, so the output string is platform-independent.
-
The maximum length of the returned string is 39 (4 x 8 + 7).
-
The returned string uses lowercase letters to represent IPv6 addresses.
Examples
SELECT INET6_NTOA(INET6_ATON('fdfe::5a55:caff:fefa:9089'));
+------------------------------------------------------------+
| INET6_NTOA(INET6_ATON('fdfe::5a55:caff:fefa:9089')) |
+------------------------------------------------------------+
| fdfe::5a55:caff:fefa:9089 |
+------------------------------------------------------------+
1 row in set (0.001 sec)