GBase 8a提供了inet_aton 和 inet_ntoa两个内置函数,来支持地址到数字(Address To Number) 以及数字到地址(Number To Address)功能。
目录导航
样例
gbase> select inet_aton('192.168.0.1');
+--------------------------+
| inet_aton('192.168.0.1') |
+--------------------------+
| 3232235521 |
+--------------------------+
1 row in set (Elapsed: 00:00:00.02)
gbase> select inet_ntoa(3232235521);
+-----------------------+
| inet_ntoa(3232235521) |
+-----------------------+
| 192.168.0.1 |
+-----------------------+
1 row in set (Elapsed: 00:00:00.00)