Re: transaction not work for trigger table
Hi kilin,
Try:
CREATE TABLE `t1` (
`id` int(11) default NULL,
`fecha` datetime default NULL
) ENGINE=InnoDB;
CREATE TABLE `t2` (
`id` int(11) default NULL,
`fecha` datetime default NULL
) ENGINE=InnoDB;
DELIMITER $$
CREATE TRIGGER `trgaitestt1` AFTER INSERT ON `t1`
FOR EACH ROW
BEGIN
INSERT INTO t2 VALUES (NEW.id, NEW.fecha);
END$$
DELIMITER ;
START TRANSACTION;
INSERT INTO t1 VALUES (1, NOW()), (2, NOW()), (3, NOW()), (4, NOW());
ROLLBACK;
SELECT * FROM t1;
Subject
Views
Written By
Posted
5860
June 26, 2008 07:47PM
Re: transaction not work for trigger table
2820
June 27, 2008 11:56AM
2665
July 01, 2008 04:30AM
2480
July 01, 2008 08:04PM
2312
July 03, 2008 02:55AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.