MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Difference between NO ACTION and RESTRICT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
sanjeevkumarchauhan
Beginner


Joined: 03 Oct 2005
Posts: 3
Topics: 2
Location: India

PostPosted: Mon Oct 03, 2005 12:53 am    Post subject: Difference between NO ACTION and RESTRICT Reply with quote

Hi All,

Iam relatively very new to DB2. Iam currently preparing for DB2 700 Certification. In this regard, there is a small topic which is confusing me a bit.

In Referential Constrains, NO ACTION, RESTRICT are two key words being used in controlling the functionality of UPDATE,DELETE operations . But functionally what are the differences between both the keywords.

Also I would be thankful ,if any one of you can provide me any information, about any sample test papers or Mock testpapers for DB2 700.

Thanks in Advance
SK Chauhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Oct 03, 2005 4:43 am    Post subject: Reply with quote

sanjeevkumarchauhan,

Check this link which explains in detail about the referential integrity constraints.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/1.6.2?SHELF=&DT=20010718164132&CASE=

Quote:

Also I would be thankful ,if any one of you can provide me any information, about any sample test papers or Mock testpapers for DB2 700.


check these links

http://www.mvsforums.com/helpboards/viewtopic.php?t=3574&highlight=certification

http://www.mvsforums.com/helpboards/viewtopic.php?t=2649&highlight=certification

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Tue Oct 04, 2005 8:49 am    Post subject: Reply with quote

sanjeevkumarchauhan,

To answer your specific question about the difference between RESTRICT and NO ACTION referential integrity delete rule, the difference is so subtle that they are interchangeable in almost all practical situations. The only situation that I could find where the difference matters is on a AFTER trigger.

Basically, RESTRICT enforces the delete rule immediately whereas NO ACTION enforces the delete rule at the end of the statement.

Now consider that you have an AFTER trigger on delete operations on a parent table, which is present in a referential integrity relationship. Suppose you now do a delete (which invokes the trigger but violates the referential integrity relationship). Now, if you have coded RESTRICT as the delete rule, the delete is not at all allowed and hence the trigger is not fired. But if you have coded NO ACTION, the delete rule is not immediately checked but checked at the end of the statement. Hence, the trigger is fired although the delete statement itself on the parent table is not allowed to proceed after the referential integrity checks.

So, in cases like this, it is important to know the difference between the RESTRICT and NO ACTION.

HTH...Regards,
Manas
_________________
There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948)
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group