delimiter $ drop trigger if exists insert_color $ create trigger insert_color before insert on color for each row begin insert into co(cols) values(new.col); end $ delimiter ;
delimiter $ drop trigger if exists insert_color $ create trigger insert_color after insert on color for each row begin insert into co(cols) values(old.col); end $ delimiter ;
delimiter $ drop trigger if exists insert_color $ create trigger insert_color before delete on color for each row begin insert into co(cols) values(new.col); end $ delimiter ;
delimiter $ drop trigger if exists insert_color $ create trigger insert_color after delete on color for each row begin insert into co(cols) values(old.col); end $ delimiter ;
delimiter $ drop trigger if exists insert_color $ create trigger insert_color before update on color for each row begin insert into co(cols) values(new.col); end $ delimiter ;
delimiter $ drop trigger if exists insert_color $ create trigger insert_color after update on color for each row begin insert into co(cols) values(old.col); end $ delimiter ;
trigger 触发器 delete 删除 before 之前 for each row 对于每一行 old 老的 new 新的 updata 更新
delimiter $ -- delimiter 把 ; 改成 $ 结尾 drop trigger if exists insert_loguser $ -- 删除触发器 条件:如果存在 create trigger insert_color after insert on userinfo for each row -- 创建触发器 name 插入之后 table 每一行 begin -- 开始 insert into loguser(log_user,log_pwd) values(NEW.user_name,NEW.user_pwd); -- 插入 table(column) 值(NEW.) end $ delimiter ;