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
1010
August 23, 2019 06:54AM
540
August 23, 2019 07:42AM
488
August 23, 2019 01:16PM


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.