这是我的脚本和我得到的错误。我做错了什么?
create table PHONE_USERS (
TELEPHONE_NUMBER VARCHAR2(80) NOT NULL, PRIMARY KEY
FIRST_NAME VARCHAR2(80),
LAST_NAME VARCHAR2(80),
KEYMAP_LASTNAME CHAR(4),
"PASSWORD" VARCHAR2(80),
CONSTRAINT LAST_NAME UNIQUE (TELEPNONE_NUMBER)
);
命令行错误:7列:31
错误报告 -
SQL错误:ORA-00904:“TELEPNONE_NUMBER”:标识符无效 00904. 00000 - “%s:无效标识符”
*原因:
*行动:
答案 0 :(得分:1)
TELEPNONE_NUMBER
拼写错误。必须是TELEPHONE_NUMBER
create table PHONE_USERS (
TELEPHONE_NUMBER VARCHAR2(80) NOT NULL PRIMARY KEY,
FIRST_NAME VARCHAR2(80),
LAST_NAME VARCHAR2(80),
KEYMAP_LASTNAME CHAR(4),
"PASSWORD" VARCHAR2(80),
CONSTRAINT LAST_NAME UNIQUE (TELEPHONE_NUMBER)
);
答案 1 :(得分:0)
发生此错误,因为我认为在NOT NULL
和TELEPHONE_NUMBER
拼写不匹配之后放置了逗号。
将TELEPNONE_NUMBER
更改为TELEPHONE_NUMBER
create table PHONE_USERS (
TELEPHONE_NUMBER VARCHAR2(80) NOT NULL PRIMARY KEY,
FIRST_NAME VARCHAR2(80),
LAST_NAME VARCHAR2(80),
KEYMAP_LASTNAME CHAR(4),
"PASSWORD" VARCHAR2(80),
CONSTRAINT LAST_NAME UNIQUE (TELEPHONE_NUMBER)
);