List:General Discussion« Previous MessageNext Message »
From:Wachira  Promsaka Na Sakolnakorn Date:September 24 1999 7:13pm
Subject:on delete cascade ??
View as plain text  
Hi all,

I wonder what does "on delete cascade" meaning.
I create two tables for test as below:

CREATE TABLE paper (
 paper_id char(12) not null,
 abbr_id char(10) not null,
 unique (paper_id,abbr_id),
 primary key (paper_id),
 foreign key (abbr_id) references abbreviation
  on delete cascade
  on update cascade);

CREATE TABLE abbreviation (
 abbr_id char(10) not null,
 unique (abbr_id),
 primary key (abbr_id));

After that I insert some information on these 2 tables then  I test it by
delete one tuple from abbreviation table but there was no effect on paper
table. So what does "on delete cascade" mean? or I do something wrong?  At
first I thought when I delete the information from one table, the
information on another table will be delete automatically? Am I wrong ?

please help me, I'm MySQL newbie.
Thank you very much.
-Wachira-

Thread
on delete cascade ??Wachira  Promsaka Na Sakolnakorn24 Sep
  • Re: on delete cascade ??Paul DuBois24 Sep
  • Re: on delete cascade ??Nicolas Ross24 Sep
  • Re: on delete cascade ??Bob Kline24 Sep