Quantcast
Viewing all articles
Browse latest Browse all 3724

xpost from triggers: create before insert, mysqlworkbench: the object's DDL contains syntax error (no replies)

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

or

CREATE DEFINER = CURRENT_USER TRIGGER family2.family_members_BEFORE_INSERT BEFORE INSERT ON family_members FOR EACH ROW
BEGIN
declare dob date;
select p.birth_date
into dob
from people as p
where p.people.id = new.people_people_id;
new.people_people_id := dob;
END;

Can you spot the syntax error? I can't.

Viewing all articles
Browse latest Browse all 3724

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>