MySQL Forums
Forum List  »  Newbie

the best way to insert default datetime
Posted by: odelya glick
Date: October 31, 2009 05:42PM

hi

i have to insert value into a table where it will always be the current time.

my column is of time datetime.

i thought to create a trigger like this:

CREATE TRIGGER insert_date BEFORE INSERT ON usercase FOR EACH ROW SET NEW.caseend = NOW();

what is better for performance: a trigger, or inserting the current date via the code?

thanks

Options: ReplyQuote


Subject
Written By
Posted
the best way to insert default datetime
October 31, 2009 05:42PM


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.