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

Home -> Community -> Usenet -> comp.databases.theory -> Re: optionality and cardinality moving from from ERD to TABLES.

Re: optionality and cardinality moving from from ERD to TABLES.

From: Andrea Fare' <fardrum_at_hotmail.com>
Date: Sun, 30 Sep 2001 20:12:40 -0700
Message-ID: <xzOt7.1889$Uf2.331972@news20.bellglobal.com>


the magic phrase works pretty good!
thanks David and Jan

Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl> wrote in message news:9p1pag$s3$1_at_news.tue.nl...
> Andrea Fare' wrote:
> > Thanks JAN and HEINZ (hope this is your name and not your lastname;-)
for
> > your answers .
> > Since it is impossible to create a REFERENCE to a non unique field in
Oracle
> > , it seems impossible to me to implement your solution,
>
> Then formulate it as a general constraint with CHECK where you can
> define any constraint that you can formulate with SQL. It does mean
> that you have to formulate the foreign key constraint in SQL, which may
> not be easy if you are new at SQL. It's also not very efficient.
>
> > imagine my person table as:
> >
> > create table person
> > (persid varchar2(10)
> > CONSTRAINT person_persid_pk PRIMARY KEY,
> > pername varchar2(10));
> >
> >
> > what kind of constraint can I put on the table to enforce that each
entry
> > has at least one corresponding entry in the following table (the car
each
> > owner must have?)
> >
> >
> > create table car
> > (carid varchar2(10)
> > constraint car_carid_pk primary key,
> > model varchar2(10),
> > owner varchar2(10) references person(persid));
> >
> >
> > it seems impossible to me to solve this problem at the table level
because
> > it generates the paradox of beeing able to enter values in both tables
at
> > exaclty the same time (!!!)
>
> The magic phrase is "deferred constraint checking". See
>
> http://www-db.stanford.edu/~ullman/fcdb/oracle/or-faq.html
>
> under "How do I specify deferred constraint checking?".
>
> --
> Jan Hidders
Received on Sun Sep 30 2001 - 22:12:40 CDT

Original text of this message

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