Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Explain about On Delete Cascade, Restrict and SET to Null

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions
Author Message
Ananya

New User


Joined: 26 Feb 2004
Posts: 21
Location: Chennai

PostPosted: Sat Feb 28, 2004 3:07 pm    Post subject: Explain about On Delete Cascade, Restrict and SET to Null
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
References
PostPosted: Sat Feb 28, 2004 3:07 pm    Post subject: Re: Explain about On Delete Cascade, Restrict and SET to Null Reply with quote

anuradha

Global Moderator


Joined: 06 Jan 2004
Posts: 257

PostPosted: Mon Mar 01, 2004 5:23 pm    Post subject: DELETE RULE
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions All times are GMT + 6 Hours
Page 1 of 1