你能解释一下我的错误是什么吗?
create table ABC.t1 (
c1 NUMBER GENERATED ALWAYS as IDENTITY ( START with 1 INCREMENT by 1 ),
c2 VARCHAR2(10)
)
错误报告 - ORA-02000:缺少(关键字 02000。00000 -“缺少 %s 关键字”
你能解释一下我的错误是什么吗?
create table ABC.t1 (
c1 NUMBER GENERATED ALWAYS as IDENTITY ( START with 1 INCREMENT by 1 ),
c2 VARCHAR2(10)
)
错误报告 - ORA-02000:缺少(关键字 02000。00000 -“缺少 %s 关键字”
“作为身份生成”功能在 Oracle 12c 上或之后工作。
在 Oracle 12c 之前:
create table t1 (
c1 NUMBER,
c2 VARCHAR2(10)
);
create sequence
t1_seq
increment by 1
start with 1;
Insert into
t1
values
(t1_seq.nextval, 'ABC');
在 Oracle 12c 中或之后:
create table ABC.t1 (
c1 NUMBER GENERATED ALWAYS as IDENTITY ( START with 1 INCREMENT by 1 ),
c2 VARCHAR2(10)
);
Insert into
t1
values
('ABC');
因此,您的声明仅适用于 12c 或更高版本。