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: 1:c - relation in oracle

Re: 1:c - relation in oracle

From: Ana C. Dent <anacedent_at_hotmail.com>
Date: Tue, 23 Dec 2003 16:34:52 -0800
Message-ID: <Na5Gb.38921$BQ5.11214@fed1read03>


Response inline below...

Christian Nein wrote:

>>Er.. since when does the N part in 1:N not mean 1:2? Or 1:1? Or 1:2?
>>
>>Or did you mean 1:3? Well, N can also be 3. Here ya go. N := 3. Thus 1:N

>
> is now 1:3.
>
>>That is why it is called a 1:N relationship.
>>
>>N can even be c. N := c. Now 1:c is also realised.
>>
>>Entity relationships are either a 1:N or N:M. Show me one that is not.
>>
>>--
>>Billy

>
>
> I think you got me wrong. Here is an example of what I mean:
>
> Let's say we have 2 tables, one containg INVOICES and a second one containg
> the associated INVOICE LINE ITEMS
>
> case 1)
> A relation shall ensure that each INVOICE exactly has 2 INVOICE LINE ITEMS
> (not 0 or 1 or 3 or 4 or ...)

One possible way would be to have the INVOICE record contain two NOT NULL columns which would be "pointers" into the INVOICE_LINE_ITEMS

>
> case 2)
> A relation shall ensure that each INVOICE has maximal one (0 or 1) INVOICE
> LINE ITEMS
See above but have 1 column for the pointer; which could be NULL.

Now, I suspect that you'll provide even more details why this is not an acceptable solution.

I contend the requirements as specified were met WITHOUT using triggers.

HTH & YMMV HAND! Received on Tue Dec 23 2003 - 18:34:52 CST

Original text of this message

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