Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: modelling IPv6 as a number
maxwell.dana_at_gmail.com wrote:
> Hi All,
>
> If I'm not mistaken, IPv6 requires 39 significant digits to represent
> each possible IP as an integer. Oracle's maximum is number(38). Has
> anyone devised a scheme to store the integer value of IPv6 in oracle?
>
> Thanks
>
> Dana
>
Crazy question, but why model this as a number? The IPv6 addresses can look like the following:
2001:db8::1428:57ab
The consecutive colons in the IPv6 address mean that zeros are all that is missing. So if you want to store this as a number, you'll have to change the given IPv6 address to the following:
2001:0db8:0000:1428:57ab
Plus, you have to deal with hex values.
Personally, I'd rather store the IPv6 address as a string. The only compelling reason I see to store as a number is to perform arithmetic on the value. Which I can't see a reason why I would do with an IP address...
Cheers,
Brian
-- =================================================================== Brian Peasland dba_at_nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - UnknownReceived on Tue Dec 12 2006 - 13:55:17 CST