List:General Discussion« Previous MessageNext Message »
From:Nanni Claudio Date:June 17 2008 12:22pm
Subject:R: delete a data from 3 tables
View as plain text  
Hi Chandra,
you have two possible situations:

Case (A) you can delete 'astro_tbl' rows with NO particular actions

Case (B1) you must alter 'astro_tbl' table adding a cascade costraint to have the system
delete rows in the 'astro_tbl' table when one row in 'authen_tbl' table is being deleted
if the 'mail' field is referred by the 'astro_tbl.mail' field

Case (B2) you must alter 'astro_tbl' table adding a cascade costraint to have the system
delete rows in the 'astro_tbl' table when one row in 'profile_tbl' table is being deleted
if the 'pid' field is referred by the 'astro_tbl.pid' field

See MySQL
manual(http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html) or my
previous reply to see syntax for altering FOREIGN KEY costraints.


Aloha!

Claudio Nanni







-----Messaggio originale-----
Da: Chandra N [mailto:chandragsk@stripped] 
Inviato: martedì 17 giugno 2008 12.06
A: mysql@stripped
Oggetto: delete a data from 3 tables

hi all
 
I created 3 tables namely authen_tbl,profile_tbl,astro_tbl,in which column
name mail  as primary key in authen_tbl table ,
query:
 pid int primary key auto_increment,
 foreign key (mail) references authen_tbl(mail) 
given in astro_tbl table 
and 
query
foreign key(pid) references profile_tbl(pid) 
given in astro_tbl.
 
My problem is how to delete a data at a strech from 3 tables.
 
Thanks 
chandra



      
Thread
delete a data from 3 tablesChandra N17 Jun
  • Re: delete a data from 3 tablesMartijn Tonies17 Jun
  • R: delete a data from 3 tablesNanni Claudio17 Jun