Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IP Address Value within a range

376519Mar 20 2008 — edited Mar 25 2008
I have this table:

GROUP_UID
GROUP_NAME
IP_VALUE_LOW
IP_VALUE_HIGH

It is used to control the grouping of ranges of IP Address. I need help on two things with this table. I am sure the solution to one will lead me to the other.

1. When given an IP_VALUE I need to return the GROUP_UID/NAME that IP_VALUE falls into. I can not use the normal between IP_VALUE_LOW and IP_VALUE_HIGH becuse the IP Value is not truly consecutive.

13150400 = 192.168.200.0
13150402 = 194.168.200.0 not 192.168.200.2
13150403 = 195.168.200.0 not 192.168.200.3
13150404 = 196.168.200.0 not 192.168.200.4
13150405 = 197.168.200.0 not 192.168.200.5
so 13150403 in not between 13150402 and 13150404
but 192.168.200.3 is between 192.168.200.2 and 192.168.200.4

2. A group is added or updated. I need to ensure that two groups do not overlap ranges.

Any Help would be great!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2008
Added on Mar 20 2008
18 comments
1,235 views