2
I want to create a discount Trigger for case the user select the form of payment 6 that is billet he has 15% discount on the amount q will be paid, then the Valorpagar q is where is the amount that the person will pick up is to receive the discounted value
CREATE TRIGGER Desconto BEFORE INSERT
ON Pagamento
FOR EACH ROW
BEGIN
IF NEW.CodigoFormaPagamento = 6 THEN
SET NEW.ValorPagar = (NEW.ValorPagar * 0.15);
END IF;
END;
I put the image to see where the error is happening
– Nathan Silva
Obg for putting the code so it’s easy to copy.
– Sam
How strange, here it is like this
– Nathan Silva
I took it, now he is not accusing error in the last END but is accusing the other two where were already
– Nathan Silva
using what you passed me worked out, but could you please explain to me?
– Nathan Silva