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 -> foreign key question

foreign key question

From: Brian Lavender <blavender_at_spk.usace.army.mil>
Date: Mon, 07 Dec 1998 23:11:05 GMT
Message-ID: <74hna7$esl$1@nnrp1.dejanews.com>


A foreign key constraint I placed on two fields in a detail table does not seem to be enforcing constraints on the table. The referenced table contains two columns which represent a composite key. THe columns in the referenced table are titled

CEFMS, COEMIS
named
PAYOUTACCTS When I created the detail table I used the following SQL statement to establish the foreign key:

create table payitemsdetails
(

   contractno varchar(16),
   invoiceno  varchar(10),
   projectno  number(2,0),
   cefms      varchar(8),
   coemis     varchar(18),
   amount     number(16,2),
   foreign key (cefms, coemis) references
    payoutaccts(cefms,coemis),
   unique (contractno, invoiceno, projectno, cefms, coemis) );

Is this way of specifying a foreign key valid?

brian

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Dec 07 1998 - 17:11:05 CST

Original text of this message

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