Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: software version number datatype
JimStrehlow_at_data911.com wrote in
news:1114552838.349349.111490_at_o13g2000cwo.googlegroups.com:
> Should Oracle consider creating a new datatype to handle data in the
> format '###.###.###.###' such as i.p. addresses and software version
> numbers?
> What sort of datatype would you call it if we could create a new data
> type?
> e.g. VERSION
>
> You can not use NUMBER format because of the multiple periods.
> Programmers currently use VARCHAR2; but you get situations where
> programmers forget and store '9.2.0.1' and '10.0.0.1' where ten-dot is
> less than nine-dot (wrong).
>
> What is the "best" data type for storing the information at present?
> Is that a good use for a custom object? How would you store the object
> into the database?
>
> Do you have a PL/SQL stored procedure or function to parse and clense
> such data in your own internal applications as a work-around the
> current lack of a new data type?
>
> Thanks in advance.
>
WTF,O? An IP# is nothing more than a 32-bit integer represented a "dotted quad" notation. Each of the 4, eight bits, "digits" can represent a value between 0 & 255 inclusive.
Think of an IP# much the same as is done with date/times. The internal representation can/could be ignored & functions can exist to make it readable for humans.
It is easier for humans to remember 4 small values than a single LARGE value; which would/can be the decimal equivalent to the 32-bit number. Received on Tue Apr 26 2005 - 21:05:00 CDT