|
Re: Format Mask for IP [message #653796 is a reply to message #653784] |
Tue, 19 July 2016 03:30   |
cookiemonster
Messages: 13965 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You can't do it with format mask. And IP shouldn't be number datatype. It should be varchar2. Generally speaking, if the number is some form of code that it would never make sense to do math on it should probably be a varchar. Use WVI to check the format.
|
|
|
|
|
Re: Format Mask for IP [message #653839 is a reply to message #653831] |
Wed, 20 July 2016 02:22   |
John Watson
Messages: 8965 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
I disagree with CM (which I don't think has happened before). A v4 IP address is a 32 bit number, and it is usually best to store it as such. By all means have your users enter it as four octal numbers, but you may want to store it as what it really is. Why? Because you may need to do arithmetic on it. For example, comparing addresses to subnet masks is impossible in the four octet version. Sure you can compare class A/B/C subnets, but how would apply, say, a 20 bit mask?
Think data types! An IP address is a number.
|
|
|
Re: Format Mask for IP [message #653841 is a reply to message #653839] |
Wed, 20 July 2016 03:09  |
cookiemonster
Messages: 13965 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Didn't occur to me you can do math on it. However with the way forms works making it a number is still problematical if you want them to enter it in the standard format. You would need to create a non-database varchar2 item to appear on the form and map it to the real, numeric database item using triggers.
|
|
|