MySQL Forums
Forum List  »  Triggers

Re: on update table how to save current user?
Posted by: Devart Team
Date: March 10, 2011 09:07AM

An 'ON UPDATE' clause of TIMESTAMP data type does not allow it. The VARCHAR data type has no this clause at all.

Instead, try to create a BEFORE UPDATE trigger that sets new values into your field.

CREATE TRIGGER trigger1
BEFORE UPDATE
ON comp_yearly_qty_1
FOR EACH ROW
BEGIN
  SET NEW.tsuser = USER();
END

Devart Company,
MySQL management tools
http://www.devart.com/dbforge/mysql/

Options: Reply• Quote


Subject
Views
Written By
Posted
Re: on update table how to save current user?
1758
March 10, 2011 09:07AM


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.