MySQL Forums
Forum List  »  Triggers

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

Hello friends

Today I come with a question, to know if it is possible to execute an if/then statement inside a trigger

Ex:

CREATE TRIGGER insert_some AFTER INSERT ON table1
FOR EACH ROW
IF NEW.field_B = 'X' THEN
    INSERT INTO table2 SET field_id VALUE NEW.id
END IF

Options: ReplyQuote


Subject
Views
Written By
Posted
Can I execute if / then statements inside a trigger?
162
August 27, 2018 06:19PM


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.