MySQL Forums
Forum List  »  Triggers

Re: If Exists Trigger syntax
Posted by: Peter Brawley
Date: January 29, 2017 07:12AM

END IF not ENDIF, but If( Exists...) is entirely unnecessary, that logic is included in the Where clause of the Update statement ...

CREATE TRIGGER incr_t BEFORE INSERT ON t FOR EACH ROW
UPDATE distributors SET licenses=licenses+1 WHERE name=NEW.distributor;

Options: ReplyQuote


Subject
Views
Written By
Posted
2374
January 29, 2017 05:55AM
Re: If Exists Trigger syntax
885
January 29, 2017 07:12AM


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.