oracle ORA-00902: 无效的数据类型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19079305/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ORA-00902: invalid datatype
提问by user2828552
I am getting the above error when I run the following query
运行以下查询时出现上述错误
create table customer (
cust_fname varchar2(15) NOT NULL,
cust_lname varchar2(15) NOT NULL,
cust_id number(9,0) NOT NULL,
address varchar2(40) NOT NULL,
city varchar2(14) NOT NULL,
postal_code number(6,0) NOT NULL,
country varchar2(14) NOT NULL,
phone_no number(12,0) NOT NULL,
e-mail varchar2(30) NOT NULL,
password varchar2(10) NOT NULL,
primary key(cust_id),
check(e-mail like '_%@_%._%')
);
Please tell what is the problem.
请告诉是什么问题。
回答by MrSimpleMind
e-mail uses a hyphen in field name.
change it to e.g. e_mail or email.
you shouldnot use (hyphen) - in field name.
您不应在字段名称中使用(连字符)-。
You could use -but it would not be a smart solution, you would need right quoting each time you query the field/table that uses hypens or other unsupported characters.
您可以使用-但它不是一个聪明的解决方案,每次查询使用连字符或其他不受支持的字符的字段/表时,您都需要正确引用。