我有两个表如下
CREATE TABLE "CLIENT"
("ID" NUMBER(*,0) NOT NULL ENABLE,
"FIRSTNAME" VARCHAR2(255 CHAR),
"LASTNAME" VARCHAR2(255 CHAR),
"TELEPHONE" VARCHAR2(255 CHAR),
CONSTRAINT "CLIENT_PK" PRIMARY KEY ("ID"))
CREATE TABLE "BCR"."RESERVATION"
("ID" NUMBER(*,0) NOT NULL ENABLE,
"MYDATE" DATE,
"USERS_ID" NUMBER(*,0) NOT NULL ENABLE,
"CLIENT_ID" NUMBER(*,0),
CONSTRAINT "RESERVATION_PK" PRIMARY KEY ("ID"),
CONSTRAINT "RESERVATION_USER_FK" FOREIGN KEY ("USERS_ID")
REFERENCES "USERS" ("ID"))
我需要使用此代码修改表(我想添加 ON DELETE CASCADE)
ALTER TABLE "RESERVATION"
ADD CONSTRAINT "RESERVATION_CLIENT_FK"
FOREIGN KEY ("CLIENT_ID")
REFERENCES "CLIENT" CONSTRAINT "CLIENT_PK" PRIMARY KEY ("ID")
ON DELETE CASCADE;
但是,收到此错误
SQL Error: ORA-01735: invalid ALTER TABLE option
有任何想法吗?