IPV4_NUM_TO_STRING
Descriptionβ
Takes a Int16γInt32γInt64 number. Interprets it as an IPv4 address in big endian. Returns a string containing the corresponding IPv4 address in the format A.B.C.D (dot-separated numbers in decimal form)
Aliasβ
- INET_NTOA
Syntaxβ
IPV4_NUM_TO_STRING(<ipv4_num>)
Parametersβ
Parameter | Description |
---|---|
<ipv4_num> | Int type converted from ipv4 |
Return Valueβ
Returns a string containing the corresponding IPv4 address in the format A.B.C.D (dot-separated numbers in decimal form), special case:
- Will return
NULL
if the input parameter is negative or larger than4294967295
(num value of'255.255.255.255'
)
Exampleβ
select ipv4_num_to_string(3232235521);
+--------------------------------+
| ipv4_num_to_string(3232235521) |
+--------------------------------+
| 192.168.0.1 |
+--------------------------------+
select num,ipv4_num_to_string(num) from ipv4_bi;
+------------+---------------------------+
| num | ipv4_num_to_string(`num`) |
+------------+---------------------------+
| -1 | NULL |
| 0 | 0.0.0.0 |
| 2130706433 | 127.0.0.1 |
| 4294967295 | 255.255.255.255 |
| 4294967296 | NULL |
+------------+---------------------------+