“not null”和“not null enable”之间有区别吗?

时间:2022-04-05 20:10:14

When we define a table in Oracle we may define the columns as:

当我们在Oracle中定义表时,我们可以将列定义为:

"NAME" VARCHAR2(80) NOT NULL ENABLE

My question is I could not understand the meaning of "ENABLE" in this statement. What would be the difference if we just define as "NAME" VARCHAR2(80) NOT NULL ?

我的问题是我无法理解本声明中“ENABLE”的含义。如果我们只定义为“NAME”VARCHAR2(80)NOT NULL会有什么区别?

1 个解决方案

#1


31  

ENABLE is the default state, so leaving it out has the same effect. The opposite would be to specify DISABLE, in which case the constraint would not be active.

ENABLE是默认状态,因此将其保留为具有相同的效果。相反的是指定DISABLE,在这种情况下约束不会是活动的。

See the constraint documentation for more information.

有关更多信息,请参阅约束文档。

#1


31  

ENABLE is the default state, so leaving it out has the same effect. The opposite would be to specify DISABLE, in which case the constraint would not be active.

ENABLE是默认状态,因此将其保留为具有相同的效果。相反的是指定DISABLE,在这种情况下约束不会是活动的。

See the constraint documentation for more information.

有关更多信息,请参阅约束文档。