MySQL Forums
Forum List  »  Triggers

Trigger AFTER INSERT ON
Posted by: jesus gonzalez
Date: August 23, 2019 06:54AM

i have created this trigger its working as intended, but its updating all the values under the column punit. what can be done to fix this issue.

DELIMITER //
CREATE TRIGGER `invetario`.`trigerupdateStock` AFTER INSERT ON `invetario`.`venta`
FOR EACH ROW BEGIN
UPDATE `invetario`.`stock` set punit = punit - new.cantidad WHERE new.particulo = new.particulo;
END;
//
DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger AFTER INSERT ON
334
August 23, 2019 06:54AM
160
August 23, 2019 07:42AM
127
August 23, 2019 01:16PM


Sorry, only registered users may post in this forum.

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.