If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Referential constraint

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-04, 07:11
rdmurthi rdmurthi is offline
Registered User
 
Join Date: Sep 2004
Posts: 4
Referential constraint

What is the difference between 'on delete no action' and 'on delete restrict' in the referential constratint. Both behaves in the same way and the explanation given in the help is not clear.

Can anybody explain with some example.

Thanks in advance.

Dakshinamurthi
Reply With Quote
  #2 (permalink)  
Old 10-28-04, 08:49
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
After reading the SQL Reference manual, in the notes section of the CREATE TABLE statement, the difference is this. They perform the same function, specifically that when a RI is attempted to be deleted, it is blocked (and returns an error) if there is a child still pointing to it. The difference is when the constraint is enforced. "RESTRICT" is checked BEFORE all other constraints.
"NO ACTION" is checked AFTER all other constraints.

HTH

Andy
Reply With Quote
  #3 (permalink)  
Old 11-01-04, 02:33
rdmurthi rdmurthi is offline
Registered User
 
Join Date: Sep 2004
Posts: 4
Thanks Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On