IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Explain about On Delete Cascade, Restrict and SET to Null


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ananya

New User


Joined: 26 Feb 2004
Posts: 19
Location: Chennai

PostPosted: Sat Feb 28, 2004 3:07 pm
Reply with quote




Dear All,


1. Can anyone EXPLAIN me with an EXAMPLE, What are ..

a. ON DELETE CASCADE

b. ON DELETE RESTRICT

c. ON DELETE SET TO NULL.

2. Also tell me What is the Action/Reaction to Parnt & Child Tables when an Delete is done on either of these tables.

All your views will be appreciated.

Thanks in advance.

Cheers

-Ananya
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Mon Mar 01, 2004 5:23 pm
Reply with quote

hi ananya,

Actually this DELETE rule is referential constraint.

The DELETE rule defines the effects that deleting a row in the referenced table has on the referencing table The DELETE rule is also used when column attributes are defined.


No DELETE rule: deleting a row in the referenced table will fail if matching rows exist.
ON DELETE CASCADE: if a row in the referenced table is deleted, all of the matching rows are deleted.
ON DELETE RESTRICT: deleting a row in the referenced table will fails if matching rows exist.
ON DELETE SET NULL: if a row in the referenced table is deleted, a NULL value is assigned to each referencing column of every matching row.
None of these referencing tables may be a NOT NULL column.


hope this helps.others can add.

THANKS AND REGARDS
ANU
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts DB2 Statistics - Using EXPLAIN and qu... DB2 1
Search our Forums:

Back to Top