MySQL Forums
Forum List  »  Triggers

Re: assign default values in trigger
Posted by: Bob Field
Date: October 15, 2006 10:52AM

For the timestamp, compare it with '0000-00-00 00:00:00', if equal, set to now().

To assign a value automatically to a primary key, use auto_increment.

Fields from NEW can't be passed as OUT or INOUT parameters to stored procedures. This is a restriction and I hope it's fixed soon. Try DECLARE'ing a variable, pass it to the SP, then SET it into the NEW column. The SELECT keyword is not needed.

Options: ReplyQuote


Subject
Views
Written By
Posted
5661
October 15, 2006 09:15AM
Re: assign default values in trigger
2372
October 15, 2006 10:52AM
2047
October 15, 2006 11:05AM
1858
October 15, 2006 11:37AM


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.