360网站管家 发表于 2015-9-28 17:05:36

mysql 触发器

CREATE TRIGGER tr_djmh_rescount_add
AFTER INSERT ON t_resource_info
FOR EACH ROW
BEGIN
if new.group_id != '2' THEN
   set @serverIp = (select `value` from t_sys_config where id=1);
   set @n =(SELECT redis_connect(@serverIp,6379));
   set @str = (select redis_incr(CONCAT('djmh_rescount_',new.group_id)));
end if;
END;
页: [1]
查看完整版本: mysql 触发器