Note: 1. Pat_visit1 table and Adt_Log table have PATIENT_ID and visit_id fields, can be associated;
Table 2. Adt_Log log_date_time time field, when there are multiple data, need to take the maximum;
The following written for himself (new) triggers, feeling is not used, the great god who give directions, enclose an error prompt (error in Adt_Log new modified or new)
The create or replace the trigger modified adt fields after the update of log_date_time on Adt_Log
For each row
The begin
The update pat_visit1 a
The set MOVE_DATE4=(select Max (log_date_time) from Adt_Log b where p. ATIENT_ID=Amy polumbo ATIENT_ID and b.v isit_id=Dr. Isit_id);
end;
CodePudding user response:

CodePudding user response:
The create or replace the trigger modified adt fields after the update of log_date_time on Adt_LogFor each row
The begin
The update pat_visit1 a
The set MOVE_DATE4=greatest (: new log_date_time, MOVE_DATE4) where visit_id=: new.. Visit_id;
end;