Home > database >  Trigger how to get to insert new data
Trigger how to get to insert new data

Time:09-18

 create or replace 
The TRIGGER ATTENCE_1
After INSERT ON HrmScheduleSign
For each row
The BEGIN
INSERT INTO uf_2019_ATTENCE (uesrid, username, subcompanyid subcompanyname, departmentid, departmentname, attendance_date, attendance_time)
The select b.i d, b.l astname c.i d, c.s. ubcompanyname, d.i d, d.d epartmentname, a.s igndate, SUBSTR (signtime, 1, 5) from HrmScheduleSign a left join Hrmresource b on a.u serid=b.i d
Left the join hrmsubcompany c on c.i d=b.s ubcompanyid1
Left the join hrmdepartment d on d.i d=b.d epartmentid
LEFT the JOIN uf_rykqxxsz e ON a.u serid=e.b h where Anderson sincom='1' and e.d KLX is not null;
END;



Don't know how to modify, so that the writing is to insert the table of data rather than the new data, what I want is when HrmScheduleSign have insert the new data, automatically inserted into the uf_2019_ATTENCE along with query results behind insert, insert the select cannot be used in the trigger?

CodePudding user response:

Call the new: new field name
  • Related