MySQL Forums
Forum List  »  Triggers

Re: Can I execute if / then statements inside a trigger?
Posted by: Giannino Di Tizio
Date: August 27, 2018 07:52PM

Thanks Peter was solved like this:

DELIMITER //
CREATE TRIGGER `open_existencia` AFTER INSERT ON `productos`
FOR EACH ROW BEGIN
IF NEW.tipo_producto = 'X' THEN
INSERT INTO existencias(producto_id) VALUES (NEW.id);
END IF;
END; //
DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Can I execute if / then statements inside a trigger?
702
August 27, 2018 07:52PM


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.