2

When I'm run this code getting error saying,

SQL Error: ORA-00905: missing keyword 00905. 00000 - "missing keyword"

*Cause:
*Action: Running it on ORACLE. Not sure how to fix it.

CREATE TABLE LAB4 (
  ROOMID1 NUMBER(8) NOT NULL,
  BUILDING1 VARCHAR2(25) NOT NULL,
  ROOMNO1 VARCHAR2(25) NOT NULL,
  CONSTRAINT ROOMPK1 PRIMARY KEY(ROOMID1));

CREATE TABLE BOOKING (
  BOOKINGID NUMBER(4) NOT NULL ,
  DAYOFWEEK CHAR(15) NOT NULL,
  TIMEOFDAY CHAR(8) NOT NULL,
  DURATION VARCHAR2(20)NOT NULL,
  UNITCODE NUMBER(8)NOT NULL,
  ROOMID NUMBER(4) NOT NULL, 
  CONSTRAINT BOOKINGPK PRIMARY KEY(BOOKINGID),
  CONSTRAINT LABFK FOREIGN KEY(ROOMID)
    REFERENCES LAB(ROOMID)
     ON UPDATE NO ACTION
    ON DELETE NO ACTION
  );
1
  • 2
    The table is called LAB4, but you are referencing LAB. Commented Sep 14, 2015 at 8:32

1 Answer 1

2

ON UPDATE NO ACTION ON DELETE NO ACTION is definitely not Oracle syntax.

Please check out the appropriate Oracle documentation (according to the version you are using - you didn't provide an Oracle version number).

The only allowed options in latest Oracle versions are:

ON DELETE CASCADE / ON DELETE SET NULL

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.