트리거 사용
CREATEDEFINER=`root`@`localhost`TRIGGER `ilsdb`.`update_datainfo`AFTER INSERT ON `ilsdb`.`lightdata`FOR EACH ROWBEGINIF EXISTS(SELECT llight, lgroup FROM lightinfo WHERE llight=NEW.llight AND lgroup=NEW.lgroup)THENUPDATE lightinfo SET llight=NEW.llight, lgroup=NEW.lgroup, lstatus=NEW.lstatus, ldimming=NEW.ldimming, llastsmps1=NEW.lsmps1, llastsmps2=NEW.lsmps2, llastrfstatus=NEW.lrfstatus, llastm..
2012.12.11