Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query

 
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
Saloon Keeper
Posts: 4033
18
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic