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 


 

 

 


 

 

 
 

On Delete Restrict or On Delete No Action Tips

Oracle Tips by Burleson Consulting

 
Question:

Does Oracle 9i or later support On delete Restrict or On delete No action option while creating foreign key?

For example

ALTER TABLE SAMPLE1 ADD FOREIGN KEY (COL1) REFERENCES SAMPLE (COL2)ON DELETE No Action ;

ALTER TABLE SAMPLE1 ADD FOREIGN KEY (COL1) REFERENCES SAMPLE (COL2)ON DELETE RESTRICT ;


Answer:

Oracle allows three different definitions under the definition of the foreign key:

  • ON DELETE CASCADE (when a referenced parent table row is removed all the child are removed automatically)
  • The ON DELETE SET NULL action allows data that references the parent key to be deleted, but not updated. When referenced data in the parent key is deleted, all rows in the child table that depend on those parent key values have their foreign keys set to null.
  • ON DELETE NO ACTION (which is the default) prevents deleting a parent when there are children (would be nice arrangement for real life)

Other referential actions not supported by FOREIGN KEY integrity constraints of Oracle can be enforced using database triggers.

Additional information on ON DELETE can be found HERE.


Comments:

The author suggests that the default or NO ACTION would be a good set up for life. While I understand that it would be nice if young children didn't lose their parents, I think it is possible to look at that statement and say that a parent can't die until he has no children. I believe that no parent should have to bury their child, so perhaps the author didn't look into the statement enough.


 

   

 

��  
 
 
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.