Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: referencing composite key in create table statement
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