Trigger - Row Level Triggering

When the stuName field of the student table is updated,

Synchronize the updated stuName to the rmstuitemfeeinfo table,

The condition is student.stuid=rmstuitemfeeinfo.studentid

[Note]: new.stuname represents the updated value, :old.stuid represents the value before the update

CREATE OR REPLACE
TRIGGER TRIGGER_STUNAME
BEFORE UPDATE OF STUNAME ON STUDENT
FOR EACH ROW
BEGIN
  update rmstuitemfeeinfo set studentname=:new.stuname where studentid=:old.stuid;
  
END;

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326482926&siteId=291194637
Row