创建表时出现Oracle错误

时间:2014-10-15 02:53:59

标签: sql oracle

CREATE TABLE Driver(
Driver_ID number(10) Primary key,
DriverFname varchar(15),
DriverLname varchar(15),
Train_ID number(10) Foreign key References
Train(Train_ID)
);

我收到此错误ORA-00907:当我尝试运行它时缺少右括号

1 个答案:

答案 0 :(得分:1)

取出Foreign key - 您不需要这样做。只是Train_ID number(10) References Train(Train_ID)

所以运行这个:

CREATE TABLE Driver(
Driver_ID number(10) Primary key,
DriverFname varchar(15),
DriverLname varchar(15),
Train_ID number(10)  References
Train(Train_ID)
);