When we define a table in Oracle we may define the columns as:
"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
?
By default, a column can hold NULL values. The NOT NULL constraint enforces a column to NOT accept NULL values. This enforces a field to always contain a value, which means that you cannot insert a new record, or update a record without adding a value to this field.
The IS NULL condition is satisfied if the column contains a null value or if the expression cannot be evaluated because it contains one or more null values. If you use the IS NOT NULL operator, the condition is satisfied when the operand is column value that is not null, or an expression that does not evaluate to null.
A NOT NULL constraint in SQL is used to prevent inserting NULL values into the specified column, considering it as a not accepted value for that column. This means that you should provide a valid SQL NOT NULL value to that column in the INSERT or UPDATE statements, as the column will always contain data.
The NOT NULL constraint enforces a column to not accept NULL values, which means that you cannot insert or update a record without adding a value to this field.
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.
See the constraint documentation for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With