mysql - create trigger to alter multiple tables -
i have n tables,
and each table share common column 'colx'. , each table's colx column can have independent values in column, when alters value in main table t's colx, each table's corresponding colx value must updated new value in t's colx.
i can write trigger 1 table only, how write n tables?
colxcascade triggers through tables,
table1 trigger updates table2, table2 can run triggers affect table3
create table table1 (colx int not null, primary key (id) ); create table table2 (id int, colx int, index par_ind (parent_id), foreign key (colx) references table1(colx) on update cascade )
Comments
Post a Comment