Newsgroups: comp.databases.oracle.server
Path: text.usenetserver.com!out03b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!news4.google.com!news.glorb.com!sws1!ornl!news.er.usgs.gov!news
From: Brian Peasland <dba@nospam.peasland.net>
Subject: Re: modelling IPv6 as a number
In-Reply-To: <1165952118.737337.35940@80g2000cwy.googlegroups.com>
X-Nntp-Posting-Host: edc-cv-160-65.cr.usgs.gov
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Message-ID: <JA6FC8.7F8@igsrsparc2.er.usgs.gov>
User-Agent: Thunderbird 1.5.0.8 (Windows/20061025)
Sender: news@igsrsparc2.er.usgs.gov (Janet Walz (GD) x6739)
Content-Transfer-Encoding: 7bit
Organization: U.S. Geological Survey, Reston VA
References: <1165952118.737337.35940@80g2000cwy.googlegroups.com>
Mime-Version: 1.0
Date: Tue, 12 Dec 2006 19:55:17 GMT
Lines: 47
Xref: usenetserver.com comp.databases.oracle.server:419045
X-Received-Date: Tue, 12 Dec 2006 15:14:02 EST (text.usenetserver.com)

maxwell.dana@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@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
