创建表时出现sql错误“ORA-00907:缺少右括号”[关闭]

问题描述 投票:-1回答:1

我正在尝试创建表,但表ROUTE发生错误。我不知道为什么。你能指出我的问题吗?谢谢。

create table LOCATION (  
  airportCode   VARCHAR2(10) not null,  
  country       VARCHAR2(15) not null,  
  address       VARCHAR2(50) not null,  
  PRIMARY KEY(airportCode));

create table ROUTE (  
  routeID       VARCHAR2(10) not null,  
  airportCode   VARCHAR2(10) not null,  
  description   VARCHAR2(100) not null,  
  PRIMARY KEY(routeID, airportCode)
  FOREIGN KEY(airportCode) REFERENCES LOCATION(airportCode));

此错误即将发生,ORA-00907:缺少右括号。所有括号都已正确放置但仍显示此错误。

sql database oracle sqlplus
1个回答
0
投票

PRIMARY KEY(routeID, airportCode)and FOREIGN KEY(airportCode)之间有一个(逗号)缺失

© www.soinside.com 2019 - 2024. All rights reserved.