Trigger

24 views
Skip to first unread message

Phil Newell

unread,
Jun 21, 2018, 7:31:25 AM6/21/18
to Sequel Pro
Sequel pro wont let me add multiple If statements inside a trigger. It says there is a syntax error.

if (old.tradePackQty <> new.tradePackQty) then
INSERT INTO logs(user_id, tableName, tableKey, description, tableField, oldValue, newValue) VALUES (99, 'products', OLD.id, 'Updated Product', 'tradePackQty', old.tradePackQty, new.tradePackQty);
end if;

if (old.tradePrice <> new.tradePrice) then
INSERT INTO logs(user_id, tableName, tableKey, description, tableField, oldValue, newValue) VALUES (99, 'products', OLD.id, 'Updated Product', 'tradePrice', old.tradePrice, new.tradePrice);
end if;

Any idea how to change this?
Reply all
Reply to author
Forward
0 new messages