0

I'm creating tables for a college excercise, but I keep getting an error executing the query and I can't find the error. SQL Developer is awful specifying it.

This is the SQL Developer output:

Error stating in line 58:
CREATE TABLE deportexevento(
  id_evento NUMBER NOT NULL,
  id_deporte NUMBER NOT NULL,
  CONSTRAINT pk_deportexevento PRIMARY KEY (id_evento, id_deporte),
  CONSTRAINT fk_evento_deportexevento
    FOREIGN KEY (id_evento)
    REFERENCES evento(id),
  CONSTRAINT fk_deporte_deportexevento
    FOREIGN KEY (id_deporte)
    REFERENCES deporte(id)
)

CREATE TABLE evaluador(
  cuil VARCHAR(15) NOT NULL,
  nombre VARCHAR(60) NOT NULL,
  email VARCHAR(60) NOT NULL,
  CONSTRAINT pk_evaluador PRIMARY KEY (cuil)
)
Error report -
Error SQL: ORA-00922: missing or invalid option
00922. 00000 -  "missing or invalid option"
*Cause:    
*Action:

Full SQL: https://pastebin.com/pfCz5Jwt

1 Answer 1

1

Try a semicolon after each of your create statements, as below...

CREATE TABLE deportexevento
(
    id_evento NUMBER NOT NULL,
    id_deporte NUMBER NOT NULL,
    CONSTRAINT pk_deportexevento PRIMARY KEY ( id_evento, id_deporte ),
    CONSTRAINT fk_evento_deportexevento
        FOREIGN KEY ( id_evento )
        REFERENCES evento( id ),
    CONSTRAINT fk_deporte_deportexevento
        FOREIGN KEY ( id_deporte )
        REFERENCES deporte( id )
);
CREATE TABLE evaluador
(
    cuil VARCHAR( 15 ) NOT NULL,
    nombre VARCHAR( 60 ) NOT NULL,
    email VARCHAR( 60 ) NOT NULL,
    CONSTRAINT pk_evaluador PRIMARY KEY ( cuil )
);
Sign up to request clarification or add additional context in comments.

3 Comments

The output of SQL Developer doesn't print the semicolons, as you can see in the full SQL. Thought of pointing that out in the original post :P
All of your CREATE statements apart from deportexevento have semicolons after then in the full SQL.
Oh my god, though I checked that, so I discarded it. Thanks

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.