Storing IP addresses in DB2 database

David (cahoot) Wilson

Storing IP addresses in DB2 database
Hi all,
We run DB2/UDB 7.2 on AIX.
I've been asked to come up with a design for some tables that will hold IP
addresses for querying and sorting. There are various options I can see but
none are particularly elegant.
Is there some 'industry standard' that is considered to be the 'best' way of
storing IP addresses.
Any suggestions would be gratefully received.

David Wilson
DBA, Web Support
cahoot
Tel : 01494-835672 (W)
07791-096762 (M)





*********************
Internet communications are not necessarily secure and may be intercepted or
changed after they are sent. cahoot does not accept liability for any such
changes.
If you wish to confirm the origin or content of this communication, please
contact the sender using an alternative means of communication.

This communication does not create or modify any contract.

This email may contain confidential information intended solely for use by
the addressee. If you are not the intended recipient of this communication
you should destroy it without copying, disclosing or otherwise using its
contents.

Please notify the sender immediately of the error.

cahoot is a division of Abbey National plc.
Abbey National plc is registered in England, registered number 2294747.
Registered Office: Abbey National House, 2 Triton Square, Regent's Place,
London, NW1 3AN.

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Binyamin Dissen

Re: Storing IP addresses in DB2 database
(in response to David (cahoot) Wilson)
On Tue, 6 Jan 2004 10:04:37 -0000 "Wilson, David (cahoot)"
<[login to unmask email]> wrote:

:>We run DB2/UDB 7.2 on AIX.
:>I've been asked to come up with a design for some tables that will hold IP
:>addresses for querying and sorting. There are various options I can see but
:>none are particularly elegant.
:>Is there some 'industry standard' that is considered to be the 'best' way of
:>storing IP addresses.

Assuming true IP addresses (and not domain names) split it up into fours parts
and save it as a fullword. You can write a function to split/combine.

And depending on the search, you may need to control that via function as

123.46.089.5

is the same as

123.046.89.05

is the same as

123.46.89.5

etc.

Finally, remember six part IP is on the way.

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm