ora-00907:oracle 10g中缺少右括号

vecaoik1  于 2021-07-24  发布在  Java
关注(0)|答案(1)|浏览(428)

我正在创建一个表,但是它一直给我错误。
ora-00907:右括号缺失
我的代码:

CREATE TABLE EMP (
    ENO CHAR(3) NOT NULL PRIMARY KEY,
    ENAME VARCHAR(50) NOT NULL,
    JOB_TYPE VARCHAR(50) NOT NULL,
    MANAGER CHAR(3) DEFAULT NULL,
    HIRE_DATE DATE NOT NULL,
    DNO INTEGER(11) NOT NULL,
    COMMISSION DECIMAL(10,2) DEFAULT NULL,
    SALARY DECIMAL(7,2) NOT NULL,
    CONSTRAINT DNO FOREIGN KEY (DNO) REFERENCES DEPARTMENTS(DNO),
    CONSTRAINT MANAGER FOREIGN KEY (MANAGER) REFERENCES EMP(ENO)
);
xwbd5t1u

xwbd5t1u1#

删除整数的大小( DNO 列):

SQL> select * from v$version where rownum = 1;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi

SQL> CREATE TABLE EMP
  2  (
  3     ENO         CHAR (3) NOT NULL PRIMARY KEY,
  4     ENAME       VARCHAR (50) NOT NULL,
  5     JOB_TYPE    VARCHAR (50) NOT NULL,
  6     MANAGER     CHAR (3) DEFAULT NULL,
  7     HIRE_DATE   DATE NOT NULL,
  8     DNO         INTEGER NOT NULL,
  9     COMMISSION  DECIMAL (10, 2) DEFAULT NULL,
 10     SALARY      DECIMAL (7, 2) NOT NULL,
 11     CONSTRAINT DNO FOREIGN KEY (DNO) REFERENCES DEPARTMENTS (DNO),
 12     CONSTRAINT MANAGER FOREIGN KEY (MANAGER) REFERENCES EMP (ENO)
 13  );

Table created.

SQL>

相关问题