View previous topic :: View next topic |
Author |
Message |
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Thu Jan 06, 2005 5:18 am Post subject: DB2 DELETE |
|
|
Hi,
I'm deleting a record in parent table, inorder to delete all the records in child tables related to the parent key if i use on delete cascade will it delete all the records in child tables? Here the records are spread into different tables from one segment(ims). In ims he is deleting the record then that record will be deleted. to do the same in db2 if i mention ondelete cascade will all the records pertaining to that parent record will be deleted or not?
Thanks in advance and Wish you Happy New year.
nadh |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Thu Jan 06, 2005 6:10 am Post subject: |
|
|
Quote: |
if i use on delete cascade will it delete all the records in child tables?
|
Nadh,
Your child tables should be defined with DELETE CASCADE when they are created. This allows the rows to be deleted from the child table when the parent key is deleted
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|