View previous topic :: View next topic
|
Author |
Message |
Ananya
New User
Joined: 26 Feb 2004 Posts: 19 Location: Chennai
|
|
|
|
Dear All,
1. Can anyone EXPLAIN me with an EXAMPLE, What are ..
a. ON DELETE CASCADE
b. ON DELETE RESTRICT
c. ON DELETE SET TO NULL.
2. Also tell me What is the Action/Reaction to Parnt & Child Tables when an Delete is done on either of these tables.
All your views will be appreciated.
Thanks in advance.
Cheers
-Ananya |
|
Back to top |
|
|
anuradha
Active User
Joined: 06 Jan 2004 Posts: 247 Location: Hyderabad
|
|
|
|
hi ananya,
Actually this DELETE rule is referential constraint.
The DELETE rule defines the effects that deleting a row in the referenced table has on the referencing table The DELETE rule is also used when column attributes are defined.
No DELETE rule: deleting a row in the referenced table will fail if matching rows exist.
ON DELETE CASCADE: if a row in the referenced table is deleted, all of the matching rows are deleted.
ON DELETE RESTRICT: deleting a row in the referenced table will fails if matching rows exist.
ON DELETE SET NULL: if a row in the referenced table is deleted, a NULL value is assigned to each referencing column of every matching row.
None of these referencing tables may be a NOT NULL column.
hope this helps.others can add.
THANKS AND REGARDS
ANU |
|
Back to top |
|
|
|