MySQL Forums
Forum List  »  MySQL Workbench

Re: xpost from triggers: create before insert, mysqlworkbench: the object's DDL contains syntax error
Posted by: Kenneth Christensen
Date: December 06, 2020 02:15PM

Thanks, but that still gives a DDL syntax error. Well it doesn't actually give you the error, but just tells you that you have one <shrug developer guessing games >.

Your suggestion

CREATE DEFINER = CURRENT_USER TRIGGER family2.family_members_BEFORE_INSERT BEFORE INSERT ON family_members FOR EACH ROW
BEGIN
set new.person_join_date =
select birth_date
from people
where people_id=new.people_people_id;
END;


as well a minor variation

CREATE DEFINER = CURRENT_USER TRIGGER family2.family_members_BEFORE_INSERT BEFORE INSERT ON family_members FOR EACH ROW
BEGIN
set new.person_join_date = (
select birth_date
from people
where people_id=new.people_people_id;)
END;



both get the ddl syntax message

Options: ReplyQuote




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.