언어/MySQL(4)
-
인서트 시 5분 이전 데이터는 삭제 하는 트리거
CREATE TRIGGER TR_TEST AFTER INSERT ON A테이블 FOR EACH ROWBEGIN DELETE FROM A테이블 WHERE 등록일시
2013.07.25 -
트리거 사용(기존 변경)
-- Trigger DDL StatementsDELIMITER $$ USE `ilsdb`$$ 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, llasts..
2012.12.11 -
트리거 사용
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 -
You are using safe update mode and you tried to update a table without
Error Code: 1175 You are using safe update mode and you tried to update a table without a WHERE that uses a KEY columnEvery found that kind of error when trying to update rows in mysql? It’s because you tried to update a table without a WHERE that uses a KEY column (err …). MySQL을 설치하고 Update나 Delete명령문을 실행할 때 1175번 에러가 나는 경우가 있다. 이럴경우엔 Workbench에서 Edit->Preferences->SQL Queries에서 "Safe Updates"..
2012.11.30