This week's book giveaway is in the Android forum.
We're giving away four copies of Android Programming: The Big Nerd Ranch Guide and have Bill Phillips & Chris Stewart on-line!
See this thread for details.
Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Query  RSS feed

 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to use foreign keys as they establish relation between parent and child table and also if any updation or deletion is done in parent table the child table is also done with the changes?

Please tell the query...
 
Scott Selikoff
author
Bartender
Posts: 4085
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe what you are interested in is 'cascading deletes'. When you create the table reference you add the keywords "ON DELETE CASCADE" without the quotes.

The syntax may very from db to db so you might have to check google for except specifications.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!