Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: modelling IPv6 as a number

Re: modelling IPv6 as a number

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Tue, 12 Dec 2006 19:55:17 GMT
Message-ID: <JA6FC8.7F8@igsrsparc2.er.usgs.gov>


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" - Unknown
Received on Tue Dec 12 2006 - 13:55:17 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US