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: software version number datatype

Re: software version number datatype

From: D Rolfe <dwrolfeFRUITBAT_at_orindasoft.com>
Date: Wed, 27 Apr 2005 07:36:55 +0100
Message-ID: <426F3307.4080507@orindasoft.com>

JimStrehlow_at_data911.com wrote:
> 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?
>

Varchar2. When choosing a datatype you have to take into account *everything* which an can ever happen. There are two scenarios you could be dealing with here:

(a) You have a handful of version numbers to deal with - in which case you could validate them using a function or constraint, but would it be economic to write it?

(b) You have lots and lots of them. Someone, somewhere, will come up with a valid version number which will break your rule. For example the latest version of the Eclipse IDE is 3.1M6......

Stay away from custom objects.

David Rolfe Received on Wed Apr 27 2005 - 01:36:55 CDT

Original text of this message

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