ALTER TABLE MAJEST_ORDERS(
ADD CONSTRAINT PMT_STATUS CHECK (PAYMENT_STATUS ="1" OR PAYMENT_STATUS = "0"));
错误报告 - SQL错误:ORA-01735:ALTER TABLE选项无效 01735. 00000 - "无效的ALTER TABLE选项" *原因:
*操作:
答案 0 :(得分:1)
括号看起来不正确。此外,常量应该是字符串和日期的单引号:
ALTER TABLE MAJEST_ORDERS
ADD CONSTRAINT CHK_PMT_STATUS CHECK (PAYMENT_STATUS IN (0, 1));
如果值是字符串,请使用单引号:
ALTER TABLE MAJEST_ORDERS
ADD CONSTRAINT CHK_PMT_STATUS CHECK (PAYMENT_STATUS IN ('0', '1'));