Path: text.usenetserver.com!out04b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
From: Geoff Muldoon <geoff.muldoon@trap.gmail.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: modelling IPv6 as a number
Date: Wed, 13 Dec 2006 10:51:52 +1100
Message-ID: <MPG.1fe9eba6ab83d03d9898bd@news.readfreenews.net>
References: <1165952118.737337.35940@80g2000cwy.googlegroups.com> <MPG.1fe9d5c5cd62bf259898bc@news.readfreenews.net> <48eun21c7nbevj9pspfvknctcof5551pfl@4ax.com>
Organization: Southern Cross University
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.60.2060
Lines: 25
NNTP-Posting-Date: 12 Dec 2006 17:51:14 CST
X-Trace: DXC=WRL4>OhNnM]5?I?\MH??jU]AGWjF5PjPY465Ue@WB_5_gFYi?58_OhQI0V42BOHUiWbI8A6IiUbTT:n0^ha1E`oWlJ\V2XbPiiX
Xref: usenetserver.com comp.databases.oracle.server:419081
X-Received-Date: Tue, 12 Dec 2006 18:51:14 EST (text.usenetserver.com)

andy@andyh.co.uk says...
> <geoff.muldoon@trap.gmail.com> wrote:
> >maxwell.dana@gmail.com says...
> >
> >> 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?
> >
> >Why ever would you store it as a number?  It isn't an attribute to which 
> >you can naturally apply *numeric* functions, adding two IPv6 addresses 
> >together doesn't make much sense.  Store it as a string.
> 
>  One situation where the fact that an IPv4 address is a number shows up is in
> netmasks, for working out subnets and broadcast addresses. Presumably there are
> some similar operations that still apply to IPv6 addresses?

subnet ~ substring

My general rule: if you add two values together and the result is 
meaningless, it's not a number, it's a string.

Using that rule I win most arguments about also storing values such as 
phone numbers and postal/zip codes as strings instead of numbers.

Geoff M
