创建此表时出现错误,您能否提供帮助:
CREATE TABLE FIPR_MASTER (
FIPR_Id INT NOT NULL GENERATED ALWAYS
AS IDENTITY
(START WITH 100
INCREMENT BY 1
MINVALUE 100
NO MAXVALUE
NO CYCLE
NO CACHE
ORDER) PRIMARY KEY,
FIPR_NAME VARCHAR2(40) NOT NULL,
BU_NAME VARCHAR2(40) NOT NULL,
LOCATION VARCHAR2(40) NOT NULL,
RECORD_SOURCE_NAME VARCHAR2(200) NOT NULL,
PRIORITY_QUEUE VARCHAR2(40) NOT NULL,
STATUS VARCHAR2(40) NOT NULL,
INDEXING_TYPE VARCHAR2(40) NOT NULL,
SOURCE_PATH VARCHAR2(200) NOT NULL,
DESTINATION_PATH VARCHAR2(200) NOT NULL,
COMMENTS VARCHAR2(200) NOT NULL
)
错误:
CREATE TABLE FIPR_MASTER (
FIPR_Id INT NOT NULL GENERATED ALWAYS
AS IDENTITY
(START WITH 100
INCREMENT BY 1
MINVALUE 100
NO MAXVALUE
NO CYCLE
NO CACHE
ORDER) ,
FIPR_NAME VARCHAR2(40) NOT NULL,
BU_NAME VARCHAR2(40) NOT NULL,
LOCATION VARCHAR2(40) NOT NULL,
RECORD_SOURCE_NAME VARCHAR2(200) NOT NULL,
PRIORITY_QUEUE VARCHAR2(40) NOT NULL,
STATUS VARCHAR2(40) NOT NULL,
INDEXING_TYPE VARCHAR2(40) NOT NULL,
SOURCE_PATH VARCHAR2(200) NOT NULL,
DESTINATION_PATH VARCHAR2(200) NOT NULL,
COMMENTS VARCHAR2(200) NOT NULL, PRIMARY KEY(FIPR_Id)
)
Error report -
SQL Error: ORA-00907: missing right parenthesis
00907. 00000 - "missing right parenthesis"
*Cause:
*Action:
答案 0 :(得分:2)
您的DDL声明存在一些问题:
not null
计为内联约束)之前声明标识列。not null
!以下陈述适用于您,假设您在12.1或以上:
CREATE TABLE FIPR_MASTER (
FIPR_Id INT GENERATED ALWAYS
AS IDENTITY
(START WITH 100
INCREMENT BY 1
MINVALUE 100
NOMAXVALUE
NOCYCLE
NOCACHE
ORDER) PRIMARY KEY,
FIPR_NAME VARCHAR2(40) NOT NULL,
BU_NAME VARCHAR2(40) NOT NULL,
LOCATION VARCHAR2(40) NOT NULL,
RECORD_SOURCE_NAME VARCHAR2(200) NOT NULL,
PRIORITY_QUEUE VARCHAR2(40) NOT NULL,
STATUS VARCHAR2(40) NOT NULL,
INDEXING_TYPE VARCHAR2(40) NOT NULL,
SOURCE_PATH VARCHAR2(200) NOT NULL,
DESTINATION_PATH VARCHAR2(200) NOT NULL,
COMMENTS VARCHAR2(200) NOT NULL
);