MySQL Forums
Forum List  »  Triggers

INSERT INTO on AFTER UPDATE trigger
Posted by: JK Heydt
Date: June 26, 2020 06:21AM

I need to append a record into a row_change table for each AFTER UPDATE event trigger. I get an error on the last END statement. Why?

CREATE DEFINER = CURRENT_USER TRIGGER `hto_demo`.`field_AFTER_UPDATE` AFTER UPDATE ON `field` FOR EACH ROW
BEGIN
INSERT INTO row_change
(RowID, TableCd, FieldID, ChangeDateTime, RecordCreatedBit , DataBefore,DataAfter,UserID)
select
new.RowID
,'FLD'
,'110'
,Getdate()
,0
,old.FieldID
,new.FieldID
,system_user()
from field
END

Thank you

Options: ReplyQuote


Subject
Views
Written By
Posted
INSERT INTO on AFTER UPDATE trigger
1085
June 26, 2020 06:21AM


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.