aspose file tools*
The moose likes JDBC and the fly likes Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Query" Watch "Query" New topic
Author

Query

amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
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...


Thanks advance who ever answers this question.


regards
amit bhadre
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3707
    
    5

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.


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Query