简体   繁体   中英

Oracle SQL-ALTER TABLE Error

I've been looking over the following SQL code for awhile and just can't seem to find the problem. I'm relatively new to SQL, so I'm sure it's just something I'm overlooking. The error message I get is: ORA-01735: Invalid ALTER TABLE option.

Code:

ALTER TABLE PATIENT
(
ADD CONSTRAINT PProfileForeignKey
    FOREIGN KEY (pProfileID) REFERENCES PATIENT_PROFILE(Profile_ID),
ADD CONSTRAINT InsForeignKey
    FOREIGN KEY (pInsID) REFERENCES INSURANCE(Insurance_ID)
        ON DELETE SET NULL
);

I have triple checked to make sure the foreign key column names and the referenced column names are correct.

seems The parentheses are in wrong place

ALTER TABLE PATIENT
 ADD (CONSTRAINT PProfileForeignKey
    FOREIGN KEY (pProfileID) REFERENCES PATIENT_PROFILE(Profile_ID),
    CONSTRAINT InsForeignKey
    FOREIGN KEY (pInsID) REFERENCES INSURANCE(Insurance_ID)
        ON DELETE SET NULL);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM