patternMinor
What does enable mean in Oracle DDL constraint?
Viewed 0 times
enablewhatmeanddldoesconstraintoracle
Problem
My understanding is the different between
and
is that the later will also be be applied to existing data in the table. If then you are starting from scratch is there any point in doing
Thanks
NOT NULLand
NOT NULL ENABLEis that the later will also be be applied to existing data in the table. If then you are starting from scratch is there any point in doing
NOT NULL ENABLEThanks
Solution
not null is a constraint. The enable that follows it is optional if you want that constraint to be active (which is the default). So NOT NULL
NOT NULL ENABLE
NOT NULL ENABLE VALIDATEall mean the same thing (
validate is also the default, novalidate being the other option), so there really isn't an "advantage" in specifying it fully (except perhaps for documentary purposes).If you wanted that
not null constraint to be disabled, you could say:NOT NULL DISABLE -- equivalent to NOT NULL DISABLE NOVALIDATEor
NOT NULL DISABLE VALIDATESee the Specifying Constraint State docs for the details and use cases on this topic.
Code Snippets
NOT NULL
NOT NULL ENABLE
NOT NULL ENABLE VALIDATENOT NULL DISABLE -- equivalent to NOT NULL DISABLE NOVALIDATENOT NULL DISABLE VALIDATEContext
StackExchange Database Administrators Q#57123, answer score: 9
Revisions (0)
No revisions yet.