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: ORA-00905: missing keyword Need advice

Re: ORA-00905: missing keyword Need advice

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 17 Oct 2005 17:31:23 -0700
Message-ID: <1129595479.830487@yasure>


FutureZone wrote:
> Hi all,
>
> I've got this error when I create a table called "Offering" in
> SQL*Plus as follow:
>
> CREATE TABLE Offering( OfferNo INTEGER NOT NULL,
> CourseNo CHAR(6) NOT NULL,
> OffLocation VARCHAR(50),
> OffDays CHAR(6),
> OffTerm CHAR(6) NOT NULL,
> OffYear INTEGER NOT NULL,
> FacSSN CHAR(11),
> OffTime DATE,
> CONSTRAINT PKOffering PRIMARY KEY(OfferNo),
> CONSTRAINT FKCourseNo FOREIGN KEY(CourseNo) REFERENCES
> Course ON DELETE NO ACTION
> ON UPDATE NO ACTION,CONSTRAINT FKFacSSN FOREIGN
> KEY(FacSSN) REFERENCES Faculty
> ON DELETE SET NULL ON UPDATE CASCADE)
> /
>
> But the error saying missing key... What's wrong with my code? Any
> guidance? Thnks :)

Actually that is not the error message at all. And this is part of the reason we prefer actual error messages rather than your personal interpretation of an error message.

I'm going to be harsh here so if you can't handle it this is a good time to bail out and not read my answer.

One thing is abundantly clear. You have NEVER read an Oracle book, never read the documentation, and have no idea what you are doing in Oracle. Perhaps in SQL Server but certainly not in Oracle. Here are the clues.

CourNo CHAR(6) ... you've got be be kidding ... a CHAR(6) column? And one with a name indicating it is a number.

ffLocation VARCHAR(50), ... this is NOT Oracle syntax. You are wrting SQL ... not C, use VARCHAR2.

Course ON DELETE NO ACTION ... once again ... this is NOT Oracle. It is the default ... not a matter of syntax.

One of two things needs to happen here. Either: 1. You need to say Oops. posted in the wrong product group or
2. You need to stop writing code until you take at east a year's worth of classes on the product you are using.

If you were a first-quarter student in my program at the U this would have earned you an opportunity to leave the program and nothing else.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Oct 17 2005 - 19:31:23 CDT

Original text of this message

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