Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> supersunday modeling question
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