View previous topic :: View next topic
|
Author |
Message |
ranjita_biswal
New User
Joined: 23 Feb 2005 Posts: 5
|
|
|
|
Hi,
Can we delete from a primary table if child tables are there?
Thanks
Ranjita |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
It depends on the definition of the table, if restrict on delete is specified you can not but if cascade on delete or set null on delete is specified you can. |
|
Back to top |
|
|
ranjita_biswal
New User
Joined: 23 Feb 2005 Posts: 5
|
|
|
|
Hi,
Thanks.If nothing is specified on delete table what will happen? |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Default is cascade on delete I suppose |
|
Back to top |
|
|
murali.gummadi
New User
Joined: 17 May 2006 Posts: 5
|
|
|
|
Hi prasadvrk,
will u please clarify above answer is correct or not.
I think ON DELETE RESRTICT is the defauly.
But you have mentioned ON DELETE CASCADE is default.
Plz clarify this.
Correct me if i am wrong
Thanks & Regards
Murali |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Hi Gummadi,
Iwas not sure(as I am not a DBA) that's why I said 'I suppose' . I concentrated on the first part of the question. Thanks for correcting me. |
|
Back to top |
|
|
vidhyanarayanan
New User
Joined: 23 Dec 2005 Posts: 52
|
|
|
|
Hi,
If no Delete Rule definition is provided when the referential constraint is
defined, the ON DELETE NO ACTION definition is used as the default. |
|
Back to top |
|
|
|