Trigger after insert
Hello Everyone, could you please help me on this?
I have the following situation:
DELIMITER $$
USE `nfce`$$
DROP TRIGGER /*!50032 IF EXISTS */ `x`$$
CREATE
/*!50017 DEFINER = 'root'@'localhost' */
TRIGGER `x` AFTER INSERT ON `fp_itensporcupom_nfce`
FOR EACH ROW BEGIN
UPDATE rpro_ecommerce.tb_produtos
SET
qtde = qtde -nfce.fp_itensporcupom_nfce.Quantidade
WHERE
CodigoProduto = nfce.fp_itensporcupom_nfce.CodigoProduto;
END;
$$
DELIMITER ;
When I try to insert on the table nfce.fp_itensporcupom_nfce I get the error:
Error Code : 1054
Unknown column 'nfce.fp_itensporcupom_nfce.CodigoProduto' in 'where clause'
thanks!
Subject
Views
Written By
Posted
Trigger after insert
2024
February 16, 2017 06:46PM
768
March 08, 2017 02:30PM
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.