MySQL Forums
Forum List  »  Triggers

Trigger error
Posted by: gary Wood
Date: May 06, 2016 02:51PM

I am new to mysql, used to be pretty fluent in DBASE IV but that was a long time ago! Dbase seemed much easier to accomplish tasks, but learning something new is always fun! I am getting a syntax error for the trigger below. If I ignore it the trigger works fine, but do not like errors!

CREATE DEFINER=`gary`@`%` TRIGGER `BM`.`FC1_BEFORE_UPDATE` BEFORE UPDATE ON `FC1` FOR EACH ROW
BEGIN
SET NEW.total = (ifnull(NEW.h1_qty,0) + ifnull(NEW.h2_qty,0) + ifnull(NEW.h3_qty,0) + ifnull(NEW.h4_qty,0) + ifnull(NEW.h5_qty,0) + ifnull(NEW.h6_qty,0) + ifnull(NEW.h7_qty,0) + ifnull(NEW.h8_qty,0) + ifnull(NEW.h9_qty,0) + ifnull(NEW.h10_qty,0) + ifnull(NEW.h11_qty,0) + ifnull(NEW.h12_qty,0) + ifnull(NEW.h13_qty,0) + ifnull(NEW.h14_qty,0) + ifnull(NEW.h15_qty,0) + ifnull(NEW.h16_qty,0) + ifnull(NEW.h17_qty,0));
SET NEW.total_lbs = NEW.total/453.592;
END

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger error
1342
May 06, 2016 02:51PM
659
May 06, 2016 03:48PM


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.