How is a constraint enabled?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

How is a constraint enabled?

Rating:

A constraint is enabled using the ENABLE clause of the ALTER TABLE statement. When enabling a constraint, the VALIDATE or NOVALIDATE keyword can be used with the ENABLE clause.

The VALIDATE keyword specifies that all existing rows in the table and new rows inserted in the table must comply with the constraint. Therefore, when enabling a constraint by using the ENABLE VALIDATE clause, if any row in the table violates the constraint, the constraint remains disabled and Oracle returns an error. If all rows comply with the constraint, Oracle enables the constraint. Subsequently, if a new row being inserted in the table does not comply with the constraint, the row insertion fails and Oracle returns an error.

The NOVALIDATE keyword specifies that the existing rows in the table may violate the constraint. However, new rows inserted in the table must comply with the constraint.

Note: When enabling a constraint, if a keyword is not specified with the ENABLE clause, it is taken as VALIDATE.


Rating:



Other articles

Click here to Article home

MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+

Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g, 1Z0-040: Upgrade to OCA 10g Fundamentals I, Oracle Fundamentals II, Admin I, Oracle Admin II, PL/SQL CIW foundation    Photoshop ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.
 
HACKER SAFE certified sites prevent over 99.9% of hacker crime.