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

Home -> Community -> Usenet -> c.d.o.misc -> Re: composite key and further logical constraint

Re: composite key and further logical constraint

From: Mike Sherrill <MSherrill_at_compuserve.com>
Date: Fri, 19 Sep 2003 09:27:10 -0500
Message-ID: <imvlmv035oikve6ejefd2cd1u7nn7644at@4ax.com>


On Thu, 18 Sep 2003 17:46:32 GMT, "Canny" <carolyn.derrick_at_gnb.ca> wrote:

>Using Oracle version 9.2
>
>create table mytable
>(busid number(4) ,
> corpid varchar2(30),
> corptype number(4),
> CONSTRAINT mytable_pk PRIMARY KEY (busid, corpid)
> )
>
>How can we ensure that for each busid there is only one corpid with
>corptype=1? It is ok for a busid to have many cases of corpid of corptype 2
>or corptype 3.

It sounds a lot like you're trying to shoehorn two different kinds of facts into one table. That's generally not a good idea.

In simple English, what are you really trying to model?

-- 
Mike Sherrill
Information Management Systems
Received on Fri Sep 19 2003 - 09:27:10 CDT

Original text of this message

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