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

Home -> Community -> Usenet -> c.d.o.tools -> Re: constraint problem in oracle

Re: constraint problem in oracle

From: Bob Fazio <rfazio_at_home.com.nospam>
Date: 2000/07/04
Message-ID: <Osm85.29641$A%3.341713@news1.rdc2.pa.home.com>#1/1

Both questions are really the same. When you create a foreign key Oracle assumes that you are creating it to the primary key on the other table. If you are using a unique constraint, then you have to specify the columns that make up the Unique key.

As for an optional foreign key. Just make the fields in the child table nullable.

--
Robert Fazio, Oracle DBA
rfazio_at_home.com
remove nospam from reply address
http://24.8.218.197/
"Sunny" <sunnyb_at_vendtek.bc.ca> wrote in message
news:8jr417$t40$1_at_newsfeed.smartt.com...

> Hi everyone
>
> How can you create One-to-many (optional relationship) in Oracle, like i
> mean how can you specify your constraint on an optional relationship. I
> tried to put the primary from one table to another table but didnt specify
> that it references to another table, that works but I was wondering if
there
> is any other way in Oracle i can do it. so it will be one to many
> relationship but optional what do i have to set in the contraints tab.
>
> One more question, when you set a foreign key in a table can it be null or
> not.
>
> thanks a lot
>
> Sunny Bagri
> Oracle Developer
>
>
Received on Tue Jul 04 2000 - 00:00:00 CDT

Original text of this message

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