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

Home -> Community -> Usenet -> c.d.o.misc -> Re: storing IP addresses

Re: storing IP addresses

From: David Pattinson <david_at_addease.com.au>
Date: Wed, 02 Jun 1999 09:22:11 +1000
Message-ID: <37546B23.40714F3@addease.com.au>


Sam,

Since you only want to search on the IP addresses, I'd suggest removing leading zeroes (if you ever see any) and periods and storing the address as an integer. When you attempt to match you will be OK so long as you remember to trim the leading zeroes from the string you are searching from.

I don't have 8i, however AFAIK there is a facility to create an index based on a function in 8i. The most elegant way of storing the adresses might be as a varchar2(15), and build a function to strip out the periods and cast them to integer. You then build an index on this function and search against that. This way your IP adresses appear in the standard format, but you get a nice compact index to search on.

Regards, David.

Sam Petitto wrote:

> Are there any IP addresses that begin with a "zero" ?
> What data type should I use to store IP addresses ?
> One of the main functions of the DB I'm building is to
> store
> and mine through these to look for hit patterns by IP
> address.
> I'm using 8i on NT
>
> TIA
>
> Sam Petitto
> Database Engineer
> N.S.T.I.
> 703.561.0420
>
Received on Tue Jun 01 1999 - 18:22:11 CDT

Original text of this message

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