I have 3 tables 1.send_sms 2.sent_sms amd 3.dlvr
when i send msg it' be in send_sms table and the status in dlvr table will be send and when the msg is deliverd the msg is moved to sent_sms and the status of dlvr table is sent.. can you pls suggest me how to write the trigger to update dlvr status to sent from send
I want to ask a query.
I have a database. I want to apply a trigger in that.
Table are: customer,order_info
customer(columns):cust_id,cust_name,total_bill
order_info(columns):cust_id,order_id,bill
Whenever there is an addition in the bill in order_info table, this bill should be added to the total_bill.
I've written a query. Please help me out because i'm facing problem while using it with mysql
QUERY:
CREATE TRIGGER `update_total_bill`
AFTER INSERT ON `ORDER_INFO` INNER JOIN `CUSTOMER`
FOR EACH ROW
BEGIN
UPDATE `customer`
SET `CUSTOMER.total_bill` = `CUSTOMER.total_bill` + (SELECT :NEW.bill FROM `ORDER_INFO`);
WHERE `CUSTOMER.customer_id` = `ORDER_INFO.customer_id`;
END
when i run this
delimiter $$
CREATE TRIGGER Employee_Trigger AFTER insert ON employee
FOR EACH ROW BEGIN
insert into employee_log values(new.id,new.first_name,new.last_name,new.start_date,new.end_date,new.city,new.description,curtime());
END$$
i got this error
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4
what should i do now ?
Please help me, when i tried to create that trigger,it shows error.
i did,
delimiter $$
CREATE TRIGGER Employee_Trigger
AFTER insert ON employee
FOR EACH ROW
BEGIN
insert into employee_log values(new.id,new.first_name,new.last_name,new.start_date,new.end_date,new.city,new.description,curtime());
END$$
delimiter ;
#1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
Please get me out of it.
mysql triggersmalati February 1, 2012 at 10:03 AM
I have 3 tables 1.send_sms 2.sent_sms amd 3.dlvr when i send msg it' be in send_sms table and the status in dlvr table will be send and when the msg is deliverd the msg is moved to sent_sms and the status of dlvr table is sent.. can you pls suggest me how to write the trigger to update dlvr status to sent from send
thanksadi February 19, 2012 at 7:10 PM
thanks bro...
export results to XML filePanchoJ February 20, 2012 at 4:01 PM
HI, How would you export these results to an XML file? Thanks
triggers in mysqlSanchit Mehra April 2, 2012 at 7:19 PM
I want to ask a query. I have a database. I want to apply a trigger in that. Table are: customer,order_info customer(columns):cust_id,cust_name,total_bill order_info(columns):cust_id,order_id,bill Whenever there is an addition in the bill in order_info table, this bill should be added to the total_bill. I've written a query. Please help me out because i'm facing problem while using it with mysql QUERY: CREATE TRIGGER `update_total_bill` AFTER INSERT ON `ORDER_INFO` INNER JOIN `CUSTOMER` FOR EACH ROW BEGIN UPDATE `customer` SET `CUSTOMER.total_bill` = `CUSTOMER.total_bill` + (SELECT :NEW.bill FROM `ORDER_INFO`); WHERE `CUSTOMER.customer_id` = `ORDER_INFO.customer_id`; END
Errorhardik July 3, 2012 at 5:07 PM
when i run this delimiter $$ CREATE TRIGGER Employee_Trigger AFTER insert ON employee FOR EACH ROW BEGIN insert into employee_log values(new.id,new.first_name,new.last_name,new.start_date,new.end_date,new.city,new.description,curtime()); END$$ i got this error MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4 what should i do now ?
facing problem,when i want to create triggerArindam sarkar July 26, 2012 at 6:45 PM
Please help me, when i tried to create that trigger,it shows error. i did, delimiter $$ CREATE TRIGGER Employee_Trigger AFTER insert ON employee FOR EACH ROW BEGIN insert into employee_log values(new.id,new.first_name,new.last_name,new.start_date,new.end_date,new.city,new.description,curtime()); END$$ delimiter ; #1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table' Please get me out of it.
drfsgrthe game September 4, 2012 at 4:46 PM
time to play the game
Post your Comment