Thursday, 29 November 2012
Coding Trigger Album
DELIMITER $$
DROP TRIGGER /*!50032 IF EXISTS */ `toko_dbc110116`.`insertAlbum`$$
CREATE TRIGGER `toko_dbc110116`.`insertAlbum` AFTER INSERT on `toko_dbc110116`.`album`
FOR EACH ROW BEGIN
insert into log values ('aryudi',now(),'INSERT');
END$$
DELIMITER ;
-------------------------------------
DELIMITER $$
DROP TRIGGER /*!50032 IF EXISTS */ `toko_dbc110116`.`UpdateAlbum`$$
create trigger `toko_dbc110116`.`UpdateAlbum` AFTER UPDATE on `toko_dbc110116`.`album`
for each row BEGIN
insert into log values ('aryudi',now(),'UPDATE');
END;
$$
DELIMITER ;
------------------------------------
DELIMITER $$
DROP TRIGGER /*!50032 IF EXISTS */ `toko_dbc110116`.`DeleteAlbum`$$
CREATE TRIGGER `toko_dbc110116`.`DeleteAlbum` AFTER DELETE on `toko_dbc110116`.`album`
FOR EACH ROW BEGIN
insert into log values ('aryudi',now(),'DELETE');
END$$
DELIMITER ;
Labels:
SQL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment