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: newbie question

Re: newbie question

From: replace this with _at_ <_at_)xs4all.nl>
Date: 1997/10/19
Message-ID: <344690d6.1472687@news.xs4all.nl>#1/1

On Mon, 13 Oct 1997 14:01:59 -0700, Bill Kincaid <wkincaid_at_mindspring.com> wrote:

>During the entry process of records into my Client table, I will allow
>the user to leave the Receipt_No field null. If the user enters a value
>into Receipt_No then I want to ensure that that value is not present in
>the Receipt table. If it is present then I want to disallow the record
>to be entered. The same goes for the VIN field and VIN table (including
>allowing a null in VIN field).

Are you sure, you made the right structure for your tables? With the presented datamodel, you have a one-to-many relationship from receipt to client. Don't you want the opposite? Like:

Client (client_no, VIN)
Receipt (client_no, receipt_no, <other fields>) VIN (client_no, VIN, <other fields>)

Now, you can insert your client without problems. When you insert a record in the receipt table, the uniqueness of the receipt_no is enforced by the PK (implicit not null, unique constraint).

Your receipt table will have a foreign key from receipt.client_no to client.client_no.

The same for VIN.


Received on Sun Oct 19 1997 - 00:00:00 CDT

Original text of this message

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