Hi, I am truing create SQl table and I am keeping getting this error ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis"

41 views Asked by At
Error starting at line : 1 in command -
CREATE TABLE DEAD( 
DEATH_ID INTEGER(10) NOT NULL,
DEATHYEAR INTEGER NOT NULL,
PRIMARY KRY(DEATH_ID)
)
Error report -
ORA-00907: missing right parenthesis
00907. 00000 -  "missing right parenthesis"
*Cause:    
*Action:
1

There are 1 answers

0
Gordon Linoff On BEST ANSWER

In Oracle, integer does not take a length. number does, so:

CREATE TABLE DEAD ( 
    DEATH_ID NUMBER(10) PRIMARY KEY,
    DEATHYEAR INTEGER NOT NULL
)

Here is a db<>fiddle.

Note that I replaced the separate primary key constraint with an in-line constraint. NOT NULL is redundant on a `PRIMARY KEY.