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 -> supersunday modeling question

supersunday modeling question

From: foothillbiker <foothillbiker_at_gmail.com>
Date: 4 Feb 2007 15:22:44 -0800
Message-ID: <1170631363.970360.217120@p10g2000cwp.googlegroups.com>


All,

Suppose I have a table like this:

15:14:55 system_at_ta64 SQL> desc rowshambow

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 ROWSHAMBOWID                              NOT NULL NUMBER
 ROCKID                                             NUMBER
 PAPERID                                            NUMBER
 SCISSORSID                                         NUMBER

rockid/paperid/scissorsid are all foreign keys to rocktable/papertable/ scissorstable, respectively.

The biz requirements are that every record in the table must have exactly one (1) of these three fields populated.

Questions:
- any clever ideas on how to enforce the rule about exactly one (1) of
the fields having data? I assume a trigger is the only option, and it's not a thing of beauty

Any advice welcome.

Platform: 10.2.0.2.0 on sixty-four (64) bit x86 solaris.

Thanks.

REgards,
Chas. Received on Sun Feb 04 2007 - 17:22:44 CST

Original text of this message

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