If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > One field for different types of data???

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-06-06, 09:34
eugene_b eugene_b is offline
Registered User
 
Join Date: Feb 2006
Posts: 1
One field for different types of data???

Hello, everyone.

I am new to this forum (although by far not new to DB design and development), but it seemed to me the most suitable place to ask for your expertise and opinion.

I have designed a database (in Oracle, but it's quite irrelevant). Now I am forced to implement the following:

Suppose you have a table with some fields. One of the fields is "UOM" (the "Units Of Measurement"). The other field is numeric and is called, for example, "SomeValue".

Now, depending of the value in the UOM field, the SomeValue field will contain different types of data. For example, if the UOM = "kg", SomeValue in this record will contain 17.2 (which is the weight in kilos). If UOM = "Quantity", then this record will have SomeValue = 3 (which is the quantity in pieces). And, if UOM = "Length", SomeValue will contain 335.65 (length in millimeters).

I know that this is totally wrong. All my previous experience cries against such design. However, I cannot find good arguments to prove my point of view (which is quite simple: if necessary, create different fields for Weight, Length and Quantity and forget about "UOM").

My questions are:
1. Am I right in believing such design to be completely wrong?
2. If I am right, could you, please, give me some rock-solid arguments to use in discussion.
3. If I am wrong and this design is good and acceptable, then why?

Thanks and best regards

Eugene
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On