MySQL Forums
Forum List  »  Triggers

Re: Setting a row's value to the primary key after insert
Posted by: Carl Dunham
Date: May 29, 2006 04:40PM

Try this:

delimiter //

CREATE TRIGGER calendar_insert_after AFTER INSERT
ON calendar
FOR EACH ROW
BEGIN
IF NEW.group_id IS NULL THEN
SET NEW.group_id = NEW.calendar_id;
END IF
END; //
delimiter ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Setting a row's value to the primary key after insert
1957
May 29, 2006 04:40PM


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.