在Oracle sql live上运行时缺少右括号[关闭]

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Oracle sql live上运行时缺少右括号[关闭]相关的知识,希望对你有一定的参考价值。

CREATE TABLE Enrollment
(
    OfferNo  NUMBER(10)  NOT NULL,
    StdNo    CHAR(11)    NOT NULL,
    EnrGrade NUMBER(3,2) NULL,

    CONSTRAINT EnrollmentPK 
        PRIMARY KEY (OfferNo, StdNo),
    CONSTRAINT OfferingFK 
        FOREIGN KEY (OfferNo) REFERENCES Offering
                ON DELETE CASCADE
                ON UPDATE CASCADE,
    CONSTRAINT StudentFK 
        FOREIGN KEY (StdNo) REFERENCES Student
                ON DELETE CASCADE
                ON UPDATE CASCADE
);
答案

您缺少约束引用的列:

CREATE TABLE Enrollment(
    OfferNo       NUMBER(10)       NOT NULL,
    StdNo         CHAR(11)      NOT NULL,
    EnrGrade      NUMBER(3,2)  NULL,
    CONSTRAINT EnrollmentPK PRIMARY KEY (OfferNo, StdNo),
    CONSTRAINT OfferingFK FOREIGN KEY (OfferNo) REFERENCES Offering(OfferNo)
    -- Here --------------------------------------------------------^
                          ON DELETE CASCADE
                          ON UPDATE CASCADE,
    CONSTRAINT StudentFK FOREIGN KEY (StdNo) REFERENCES Student(StdNo)
    -- And here ------------------------------------------------^
                          ON DELETE CASCADE
                          ON UPDATE CASCADE
);

以上是关于在Oracle sql live上运行时缺少右括号[关闭]的主要内容,如果未能解决你的问题,请参考以下文章

错误:在 Oracle 上创建索引时缺少右括号

我在 Oracle Apex ORA-00907 上遇到错误:缺少右括号

SQL Oracle 命令“缺少右括号”

在 oracle SQL 中使用 insrt 函数遇到“ORA-00907:缺少右括号”

ORACLE SQL 错误 - 缺少右括号 - 查询 [关闭]

Oracle SQL中的“缺少右括号”