Hi, I have never used a trigger before, and i am confused about the syntax.
My program uses mysql, and the tables i want to interact with are 'orders' and 'updates'
What I want is for whenever the orders table has an update or insert to the column called 'orderType' it will insert into the updates table column 'type' a value that matches the inserted/updated a value that matches the new ordertype and has a timestamp for the second value.
Please let me know if I am not being clear enough, I have never used triggers before.
Loading
Jignesh TrivediPosted Aug 5, 2012, 11:38 PM
for creating trigger with mysql please refer....
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
http://www.roseindia.net/mysql/mysql5/triggers.shtml
i am clear from which column updated in insert opration. please clerify it.
thx
hope this will help you.
patrickPosted Aug 5, 2012, 11:51 PM
as ALTER TABLE orders
ADD lastmodified TIMESTAMP
DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP;