Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Rule be enforced by referential integrity constraints

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ntmartins

New User


Joined: 03 Mar 2008
Posts: 12
Location: Lisboa, Portugal

PostPosted: Thu Dec 04, 2008 5:47 pm    Post subject: Rule be enforced by referential integrity constraints
Reply with quote

The zoo has a business rule that a food cannot be deleted if that food is the only food eaten by any animal. Can this rule be enforced by referential integrity (foreign key) constraints? (In other words, can referential integrity keep us from deleting a food from LEGAL_FOOD if that food occurs in the only species-food row for a particular species?)
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Dec 04, 2008 9:15 pm    Post subject:
Reply with quote

Hello,

Quote:
can referential integrity keep us from deleting a food from LEGAL_FOOD if that food occurs in the only species-food row for a particular species
I believe not. Referential integrity could prevent deletion if this food was eaten by some animal, but not if it is the only food eaten by an animal.

The deletion validation would go something like determining a list of animals who ate this food, then determining if this food was the only food eaten by each animal in the list. Not a feature/function of referential integrity.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Dec 04, 2008 9:22 pm    Post subject:
Reply with quote

I think it could be enforced by a trigger.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Business Rule extraction frozenblood CLIST & REXX 9 Tue Dec 27, 2016 10:06 am
No new posts Need a golden rule to avoid SQLCODE -805 kunal jain ABENDS & Debugging 8 Mon Sep 17, 2012 1:42 pm
No new posts Referencial Integrity to be enforced ... Rahul_kumar DB2 12 Tue Jul 17, 2012 8:15 pm
No new posts Referential read of an array element nightbuzzz COBOL Programming 6 Thu Apr 26, 2012 4:05 pm
No new posts Doubt in LOADing a Data into a table ... pkmurali DB2 1 Fri Aug 06, 2010 3:12 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us