sql - 创建表时出现 sql 错误“ORA-00907:缺少右括号”
问题描述
我正在尝试创建表,但表 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:缺少右括号。所有括号均已正确放置,但仍显示此错误。
解决方案
PRIMARY KEY(routeID, airportCode)
和之间缺少 ,(逗号)FOREIGN KEY(airportCode)
推荐阅读
- tensorflow - Deeplab 到 TensorRT 的转换
- google-apps-script - 不允许 ScriptApp.getUserTriggers(ss) - 尽管 oauthScopes。我错过了什么?
- node.js - 无法使用 node.js 在 mongodb 集合中删除
- python - 熊猫向前填充具有特定值的时间戳列(1秒)
- java - Java:如何创建具有“类”对象的实例?
- jenkins - Jenkins 管道:NPE,因为我在 Jenkinsfile 中输入了参数字段名称
- ios - Firebase crashlytics 报告了许多
我的生产版本中的第 0 行崩溃,这些崩溃是真的吗? - encoding - 如何在 elixir 中将二进制转换为 base10(十进制)整数
- django - 根据相关模型中的字段顺序删除重复项
- java - 在同一个路由器上使用多个通道