笨小孩做开发

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
DELIMITER $
CREATE TRIGGER delete_test_uptongdb_user AFTER delete 
ON reg_user FOR EACH ROW 
BEGIN
delete from test_uptongdb.reg_user where id=old.id;
END$
DELIMITER $
CREATE TRIGGER add_lm_uptongdb_user AFTER insert 
ON reg_user FOR EACH ROW 
BEGIN
INSERT INTO `lm_uptongdb`.`reg_user`
(`id`,
`name`,
`mobilenumber`,
`loginaccount`,
`pwd`,
`weixin`,
`cdkey`,
`fingerdata`)
VALUES
(new.id,
new.name,
new.mobilenumber,
new.loginaccount,
new.pwd,
new.weixin,
new.cdkey,
new.fingerdata);
END$
DELIMITER $
CREATE TRIGGER update_lm_uptongdb_user AFTER update 
ON reg_user FOR EACH ROW 
BEGIN
UPDATE `lm_uptongdb`.`reg_user`
SET
`name` =new.name,
`mobilenumber` = new.mobilenumber,
`loginaccount` =new.loginaccount,
`pwd` = new.pwd,
`weixin` = new.weixin,
`cdkey` = new.cdkey,
`fingerdata` = new.fingerdata
WHERE `id` = old.id;
END$
posted on 2017-03-27 10:42  笨小孩做开发  阅读(185)  评论(0编辑  收藏  举报