Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Oracle Check Constraint tips

Oracle Database Tips by Donald Burleson

Oracle Check Constraint

Oracle check constraint insures that updated or inserted values meet a specific condition.  The Oracle check constraint check condition must return a TRUE or FALSE, much Like the WHERE clause.  If the Oracle check constraint condition returns as TRUE when you use Oracle check constraint, the value is accepted by the constraint. If Oracle check constraint returns the condition as FALSE, the value is rejected. Below, we include an Oracle check constraint on the editor_active column of the EDITOR table that insures the value is either Y or N.

To put it another way, Oracle check constraint validates incoming columns at row insert time. With Oracle check constraint, rather than having an application verify that all occurrences of REGION are North, South, East, or West, an Oracle CHECK constraint can be added to the table definition to ensure the validity of the region column.

Here is an example of Oracle check constraint:

Oracle check constraint has some limitations.  For one, subqueries cannot be used within your Oracle check constraints.  Also, an Oracle check constraint is able to reference another column. Sysdate, currval, nextval, level, rowid, uid, user or userenv cannot be referenced with Oracle check constraint.

Oracle Check Constraint

Oracle check constraint cannot reference columns from other tables. There can be more than one Oracle check constraint per column, however the values being checked with Oracle check constraint must pass all Oracle check constraints on that column before being acceptable.  Oracle check constraint can also be used to check multiple columns. 

Oracle check constraint does have some limitations in its ability to validate data.  If more than one capable Oracle check constraint is needed, triggers must be implemented.

See related Check Constraint articles:

Check Constraint

Oracle Constraints

Boolean Expressions in Check Constraints

 


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.