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: referencing composite key in create table statement

Re: referencing composite key in create table statement

From: Manuela Mueller <520040906697-0001_at_t-online.de>
Date: Thu, 29 Aug 2002 20:41:21 +0200
Message-ID: <3D6E6AD1.60D6B921@t-online.de>


Cameron wrote:
>
> Hi,
>
> I'm trying to create a table in which a foriegn key of 3 attributes
> reference a composite key of 3 attributes in another by doing this:
>
> create table student (
> student_id CHAR(8) NOT NULL,
> enroll_tutorial_day VARCHAR2(9),
> enroll_tutorial_time CHAR(5),
> enroll_tutorial_room VARCHAR2(7),
> attend_tutorial_day VARCHAR2(9),
> attend_tutorial_time CHAR(5),
> attend_tutorial_room VARCHAR2(7),
> constraint student_attend_fk foriegn key (attend_tutorial_day,
> attend_tutorial_time, attend_tutorial_room) references Tutorial
> (tutorial_day, tutorial_time, tutorial_room));
>
> and it keeps telling me this:
>
>
> attend_tutorial
> *
> ERROR at line 9:
> ORA-00907: missing right parenthesis
>
> I don't understand, - there are ten left parentheses and ten right
> parentheses?
>
> Cameron

< rest snipped>

Hello Cameron,
you simply made a typo
<snip>
>constraint student_attend_fk foriegn key (attend_tutorial_day,
should be ...FOREIGN KEY

HTH
Manuela Mueller Received on Thu Aug 29 2002 - 13:41:21 CDT

Original text of this message

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