SQL “非空”和“非空启用”之间有区别吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20595008/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 00:27:41  来源:igfitidea点击:

Is there a difference between "not null" and "not null enable"?

sqloracle

提问by death7eater

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?

我的问题是我无法理解此语句中“启用”的含义。如果我们只是定义为,会有什么区别 "NAME" VARCHAR2(80) NOT NULL

回答by Mat

ENABLEis 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 constraintdocumentation for more information.

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