Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: multi-valued field?

Re: multi-valued field?

From: Chuck Hamilton <chuckh_at_dvol.com>
Date: 1997/01/07
Message-ID: <32d24e53.997438@n5.gbso.net>#1/1

>> Kevin Kane wrote:

>> >
>> > Hi. Is there such a thing in DB2 as a multi-valued field? By this I mean
>> > that I have a column called, say, AUTOMOBILES. If a person has 2
>> > cars, then I would like the AUTOMOBILES field of his record to contain
>> > 2 entries, one for each car.
>> >
>> > So, can DB2 handle this, or am I just going to have to cat the
>> > individual values together into a character string with some kind of
>> > delimiter?

You aren't coming from a PICK environment are you?

It can be done in a SQL database. The way to do it is to create a 2nd table for AUTOMOBILES (and all associated fields). This is called normalziation. Whatever you're using as the primary key for the OWNER table becomes a foreign key in the AUTOMOBILE table.

OWNER



owner_no PK
name
address
etc.

AUTOMOBILES


auto_no		PK
owner_no	FK reference to OWNER

description
license_no
etc.
--
Chuck Hamilton
chuckh_at_dvol.com

This message delivered by electronic sled dogs. WOOF!
Received on Tue Jan 07 1997 - 00:00:00 CST

Original text of this message

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