(no subject)

Mar 31, 2010 20:20

CREATE TRIGGER youngSailorUpdate AFTER INSERT ON Sailors
REFERENCING NEW TABLE NewSailors
FOR EACH ROW
.. INSERT
.... INTO YoungSailors(sid, name, age, rating)
.... SELECT sid, name, age, rating
.... FROM NewSailors N
.... WHERE N.age <= 18

This definition inserts new_sailors with age <=18_into_NewSailors after the new sailors_ have been inserted into Sailors_

Yes, SQL is loads of fun.
Previous post Next post
Up