Reputation: 21
I need execute a trigger INSERT after adding row at table subscrubetousers with a condition:
subscrubetousers.SubscrubeToUsersType = 9
BEGIN
INSERT INTO logsub Set
LogTime = NEW.subscrubetousersTime,
LogIdNote = NEW.subscrubetousersId,
LogType = NEW.SubscrubeToUsersType;
END
Upvotes: 0
Views: 65
Reputation: 4284
Just add a condition to your trigger body:
BEGIN
IF NEW.SubscrubeToUsersType = 9 THEN
INSERT INTO logsub (LogTime,LogIdNote,LogType)
VALUES (NEW.subscrubetousersTime, NEW.subscrubetousersId,NEW.SubscrubeToUsersType);
END IF;
END
Upvotes: 2