Chinaunix首页 | 论坛 | 博客
  • 博客访问: 486656
  • 博文数量: 142
  • 博客积分: 4126
  • 博客等级: 上校
  • 技术积分: 1545
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-22 10:03
文章分类

全部博文(142)

文章存档

2011年(8)

2010年(7)

2009年(64)

2008年(63)

我的朋友

分类: Mysql/postgreSQL

2011-02-25 20:37:58

DELIMITER |
CREATE TRIGGER tg_tbluser_admin_insert
AFTER INSERT
ON filemanage.tbluser
FOR EACH ROW
BEGIN
INSERT INTO ishelves.admin(suser,spwd,spower) SELECT (suser,spwd,spower) FROM filemanage.tbluser WHERE filemanage.tbluser.suser=NEW.suser;
END;|
DELIMITER ;

DELIMITER |
CREATE TRIGGER tg_tbluser_admin_delete
AFTER DELETE
ON filemanage.tbluser
FOR EACH ROW
BEGIN
DELETE FROM ishelves.admin WHERE filemanage.tbluser.suser=OLD.suser;
END;
|
DELIMITER ;

DELIMITER |
CREATE TRIGGER tg_tbluser_admin_update
AFTER UPDATE
ON filemanage.tbluser
FOR EACH ROW
BEGIN
DELETE FROM ishelves.admin WHERE ishelves.admin.suser=OLD.suser;
INSERT INTO ishelves.admin SELECT (suser,spwd,spower,stel) FROM mother WHERE filemanage.tbluser.suser = OLD.suser;
END;
|
DELIMITER ;
阅读(609) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-03-05 13:12:12

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com