在ORACLE 10G上面建一个表,总是出现‘ORA-00905: missing keyword’的错误,具体sql语句如下,请高手指点一下:
================================================================================================
CREATE TABLE MGPCONDELE (MGPCONDELE_ID NUMBER(19) NOT NULL, MBRGRP_ID NUMBER(19) NOT NULL, NAME VARCHAR2(64) NOT NULL, TYPE VARCHAR2(64) NOT NULL, PARENT VARCHAR2(64), SEQUENCE DOUBLE, OPTCOUNTER SMALLINT NOT NULL DEFAULT 0 , NEGATE SMALLINT NOT NULL DEFAULT 0, VARIABLE VARCHAR2(254), OPERATOR VARCHAR2(16), VALUE VARCHAR2(254), CONDNAME VARCHAR2(254), CONSTRAINT MBRGRPELE_PK PRIMARY KEY(MGPCONDELE_ID), CONSTRAINT MBRGRPELE_FK FOREIGN KEY (MBRGRP_ID) REFERENCES MBRGRP(MBRGRP_ID) ON DELETE CASCADE);
================================================================================================
这个语句是从DB2上面改过来的,就改了一些数据类型的定义,别的没动。
------解决方法--------------------------------------------------------
改成这样
CREATE TABLE MGPCONDELE (
MGPCONDELE_ID NUMBER(19) NOT NULL,
MBRGRP_ID NUMBER(19) NOT NULL,
NAME VARCHAR2(64) NOT NULL,
TYPE VARCHAR2(64) NOT NULL,
PARENT VARCHAR2(64),
SEQUENCE float, -- 没有double,有float
OPTCOUNTER smallINT DEFAULT 0 NOT NULL, -- NOT NULL 和 DEFAULT顺序要调整过来
NEGATE SMALLINT DEFAULT 0 NOT NULL ,
VARIABLE VARCHAR2(254),
OPERATOR VARCHAR2(16),
VALUE VARCHAR2(254),
CONDNAME VARCHAR2(254),
CONSTRAINT MBRGRPELE_PK PRIMARY KEY(MGPCONDELE_ID)
CONSTRAINT MBRGRPELE_FK FOREIGN KEY (MBRGRP_ID)
REFERENCES MBRGRP(MBRGRP_ID)
ON DELETE CASCADE
);