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: DDL Problem

Re: DDL Problem

From: Kenny Gump <kgump_at_mylanlabs.com>
Date: Thu, 18 Feb 1999 16:39:10 -0500
Message-ID: <36cc88ad.0@news.mountain.net>


The only thing that I can see that might be happening is both columns the foreign key is referencing (PLCY_ID, PLCY_PRD_EFF_DT) must be a composite primary key or unique key of the referenced table CAM_TEST4.

Kenny Gump
OCP 7.3 DBA


Cameron A. McLellan wrote in message <36CB273C.462F22DC_at_ibm.net>...
>Could someone please let me know why the following DDL statement fails
>(oracle database)? I am simply trying to create a table, its primary
>key, and a foreign key in a single statement. Is this allowed?
>
>CREATE TABLE CAM_TEST8 (
> PLCY_ID NUMBER,
> PLCY_PRD_EFF_DT DATE,
> CONSTRAINT CAM_TEST8_PK PRIMARY KEY (PLCY_ID, PLCY_PRD_EFF_DT),
> CONSTRAINT CAM_TEST8_FK FOREIGN KEY (PLCY_ID, PLCY_PRD_EFF_DT)
> REFERENCES CAM_TEST4 (PLCY_ID, PLCY_PRD_EFF_DT)
> );
>
>Any help would be greatly appreciated. Thanks
>
>cmclell_at_ibm.net
>
Received on Thu Feb 18 1999 - 15:39:10 CST

Original text of this message

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