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) |