Re: copy column with trigger
DELIMITER $$
CREATE TRIGGER trigger1
BEFORE INSERT
ON table1
FOR EACH ROW
BEGIN
SET NEW.column2 = NEW.column1;
SET NEW.column3 = NEW.column1;
END$$
DELIMITER ;
INSERT INTO table1(column1) VALUES(1);
Devart Company,
MySQL management tools
http://www.devart.com/dbforge/mysql/
Subject
Views
Written By
Posted
4289
March 29, 2011 02:46AM
1475
March 29, 2011 03:50AM
2126
March 29, 2011 04:46AM
Re: copy column with trigger
1383
March 29, 2011 07:20AM
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.