Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: foreign key rule error
victorrhee wrote:
> Hi
> Yep, I'm a newbie who needs some help. I really have tried and just
> haven't been able to sort it out.
> I'm getting an error message
> "Error at line 9
> ORA-00907: missing right parenthesis".
>
> I've checked and it definitely isn't really about a parenthesis that's
> not there. HEEEELP, I'm growing old and pulling my hair out (not a
> good look).
>
> Here's my code, please enlighten me.
> --------------------------------------------------------------
> create table WORKLOAD
> (
> ENO char(4) not null,
> PNO char(4) not null,
> LOAD number(2,1) not null,
> primary key (ENO, PNO),
> foreign key (ENO) references EMPLOYEE
> on delete cascade
> on update cascade,
> foreign key (PNO) references PROJECTS
> on delete cascade
> on update cascade
> );
> --------------------------------------------------------------
>
> Thanks in advance
> Vic
>
> --
> Posted via http://dbforums.com
I'm not sure what it is about because I would never ever create a table with the SQL you have used and stress to my students that they NEVER should. The end result of what you are creating is constraints with system generated names, not PCTFREE, PCTUSED, INITIAL, NEXT, etc. parameters and the index for the primary key constraint in the same tablespace as the table. All bad.
Create the table and then build proper constraints using ALTER TABLE being sure to specify the parameters appropriate to each object created.
Daniel Morgan Received on Mon Oct 21 2002 - 16:22:16 CDT
![]() |
![]() |