trigger stock phpmyadmin

Solutions on MaxInterview for trigger stock phpmyadmin by the best coders in the world

showing results for - "trigger stock phpmyadmin"
María
23 Jul 2016
1DELIMITER $$
2CREATE TRIGGER invlevel_AUPD
3AFTER UPDATE ON invlevel 
4FOR EACH ROW
5BEGIN
6  IF NEW.quantity < 20 THEN 
7    INSERT INTO orders (productid, amount)
8    SELECT productid, amount 
9      FROM reorder 
10     WHERE productid = NEW.productid;
11  END IF;
12END$$
13DELIMITER ;