这个脚本我做错了什么

时间:2016-11-29 12:07:29

标签: oracle

当我运行它时,我的代码有什么错误我有这个错误

ORA-00911: caractère non valide


Create table contient(
Num_Spect varchar(30) not null,
Code_Module varchar(30) not null,
constraints pk_contient primary key (Num_Spect,Code_Module),
constraints fk_spect _t_contient FOREIGN key (Num_Spect) REFERENCES specialite(Num_Spect),
constraints fk_module _t_contient FOREIGN key (Code_Module) REFERENCES module(Code_Module));

2 个答案:

答案 0 :(得分:0)

单词constraints无效 - 应为constraint

Create table contient
  (Num_Spect       varchar(30) not null,
   Code_Module     varchar(30) not null,
   constraint pk_contient
     primary key (Num_Spect, Code_Module),
   constraint fk_spect_t_contient
     FOREIGN key (Num_Spect) REFERENCES specialite(Num_Spect),
   constraint fk_module_t_contient
     FOREIGN key (Code_Module) REFERENCES module(Code_Module));

祝你好运。

答案 1 :(得分:0)

从脚本中删除autoincrement并尝试。

_t_contient