MySQL Forums
Forum List  »  Triggers

Re: copy column with trigger
Posted by: Devart Team
Date: March 29, 2011 07:20AM

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/

Options: ReplyQuote


Subject
Views
Written By
Posted
3915
March 29, 2011 02:46AM
1282
March 29, 2011 03:50AM
1897
March 29, 2011 04:46AM
Re: copy column with trigger
1118
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.