求指导,下面这个sql哪里有错误。总是提示标识符无效,无法执行,谢谢了。。。
CREATETABLEtb_criticism(criticismIDchar(11)constrainttb_criticism_criticismID_pkprima...
CREATE TABLE tb_criticism (
criticismID char(11) constraint tb_criticism_criticismID_pk primary key,
criticismContent long,
employeeID char(11) constraint tb_criticism_criticismID_fk references tb_employee(employeeID),
criticismTime date,
messageID char(11) constraint tb_criticism_criticismID_fk references tb_message(messageID),
); 展开
criticismID char(11) constraint tb_criticism_criticismID_pk primary key,
criticismContent long,
employeeID char(11) constraint tb_criticism_criticismID_fk references tb_employee(employeeID),
criticismTime date,
messageID char(11) constraint tb_criticism_criticismID_fk references tb_message(messageID),
); 展开
展开全部
两个外键名字重复了吧?
CREATE TABLE tb_criticism (
criticismID char(11) constraint tb_criticism_criticismID_pk primary key,
criticismContent long,
employeeID char(11) constraint tb_criticism_criticismID_fk_1 references tb_employee(employeeID),
criticismTime date,
messageID char(11) constraint tb_criticism_criticismID_fk_2 references tb_message(messageID),
);
CREATE TABLE tb_criticism (
criticismID char(11) constraint tb_criticism_criticismID_pk primary key,
criticismContent long,
employeeID char(11) constraint tb_criticism_criticismID_fk_1 references tb_employee(employeeID),
criticismTime date,
messageID char(11) constraint tb_criticism_criticismID_fk_2 references tb_message(messageID),
);
追问
你好,外键重名应该是一个错误,但是我改了之后还是不能执行,仍报“标识符无效”错误,应该还有错。顺便说一下这是Oracle数据库。
展开全部
倒数第二个括号后面不应该有 “ , ”
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
criticismContent long, 什么数据库 有long类型?
追问
首先谢谢你的回答,这个是Oracle数据库,是有long类型的,超长字符串 ,最大长度2G。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
最后多了一个 ( , )逗号
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询