目前使用18c,但这种明显的不一致是存在于早期版本(当然回到11g)。
在这种情况下,我在现有的表中添加多个越线约束。
所有的铁路图都在这里找到:https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/ALTER-TABLE.html
这是ALTER TABLE的铁路图

然后,这是constraint_clauses的铁路图。

最后,这是out_of_line_constraint的铁路图。

铁道图中没有(和),也没有,。但是SQL查询必须有它们。
下面是工作的代码:
Create table a ( x number );
Alter table a add (
constraint x1 check ( x > 0 ),
constraint x2 check ( x < 10)
);在阅读和解释铁道图时,我的错误在哪里?还有什么我必须知道的吗?
发布于 2019-10-11 20:28:01
你不需要括号或逗号。这样做是可行的:
alter table a
add constraint x1 check (x > 0)
add constraint x2 check (x < 10);但无论哪种方式,它都是文档错误,因为铁路图并不表示"constraint_clauses“引用是可重复的。
https://stackoverflow.com/questions/58284256
复制相似问题