Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.misc -> Re: software version number datatype

Re: software version number datatype

From: Malcolm Dew-Jones <>
Date: 26 Apr 2005 15:52:20 -0800
Message-ID: <> wrote:
: Should Oracle consider creating a new datatype to handle data in the
: format '###.###.###.###' such as i.p. addresses and software version
: numbers?

If the international SQL standards define such as datatype then Oracle should support it - but I don't think they do, so Oracle doesn't support it.

Notice that the format of ip addresses is just that - a format - it has nothing to do with the addresses themselves, (which in IP4 are 32 bit integers).

ALso note that the use of ip numbers is not related to the use of version numbers - for example it makes no sense to ask if an ip address is greater or less than another ip address, so your formatted data type would not really make much sense for ip addresses - except as a convenience.

The format of version numbers various amongst things that care about them. So for example RCS uses things like 1.1 and but _not_ 1.2.1, whereas many things would use 1.2.1 as a valid "version-like" number.

: What sort of datatype would you call it if we could create a new data
: type?
: e.g. VERSION

Depends of what you use it for, if you use it for versions then call it a 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 '' and '' 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?

I guess that a custom data type would be fine enough, though a trigger could also be used to enfore a data format that would do what you wish, or mutiple columns could also be used (major_version, Minor_version, patch_versions or whatever)

: 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?

I never needed one, but I can't imagine one would be hard to write once you decide what it is you are trying to do with the data.


This space not for rent.
Received on Tue Apr 26 2005 - 18:52:20 CDT

Original text of this message