我在 Oracle 中有以下内容作为 CREATE TABLE:
CREATE TABLE cs2_users (
empnum varchar2(12) PRIMARY KEY,
toolsId varchar2(20)
CONSTRAINT nn_cs2_users_toolsId NOT NULL
CONSTRAINT fk_cs2_users_users FOREIGN KEY REFERENCES users.userid,
admin number(1,0) DEFAULT 0
CONSTRAINT nn_cs2_users_admin NOT NULL
CONSTRAINT ck_cs2_users_admin (admin IN (0,1)),
givenname varchar2(30) NOT NULL,
middlename varchar2(30),
sn varchar2(30) NOT NULL,
mail varchar2(50) NOT NULL
);
但是它失败并出现此错误:
ERROR at line 5:
ORA-02253: constraint specification not allowed here`
当我使用 SQL*Plus 连接时,这是版本信息:
SQL*Plus: Release 11.2.0.3.0 Production on Tue Dec 18 16:38:27 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
帮助?