Storing units in the database

From: Mikito Harakiri <mikharakiri_nospaum_at_yahoo.com>
Date: 7 Jul 2005 14:48:28 -0700
Message-ID: <1120772908.800792.283660_at_o13g2000cwo.googlegroups.com>



This discussion is triggerd by Jon Heggland's message about dimensional units supported by user-defined type.

Mikito Harakiri wrote:
> vc wrote:

>> My impression is that you've got no clue as to what you are talking
>> about The impression,  of course,  can be reversed by trying to present
>> your thoughts in a coherent manner.

> The
> best I can suggest is googling "units group:sci.math". First few hits
> are pretty good ones. Perhaps, in this context that writing would have
> more sence to you.

Actually, I have trouble finding the relevant reference.

The key idea is that you treat the expression with unit symbols, for example

20 feet

formally. That is "Dimensionless number 20 multiplied by variable 'feet', whatever it might be". Now the conversion

feet = 0.3 meters

is an equation that can also be considered formally. We can substitute variables and get

20 feet = 20*0.3 meters

etc.

Now, when applied to the database, how should we store 20 feet? User defined types provide us some (quite unsophisticated) solution. But do we really have to program a class every time we want to do trivial conversions? Received on Thu Jul 07 2005 - 23:48:28 CEST

Original text of this message