﻿--------------------------------------------------------
--  DDL for Trigger CUR_SOFTWARE_OPERATION_MODE
--------------------------------------------------------

CREATE OR REPLACE EDITIONABLE TRIGGER "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" AFTER UPDATE OF END_TIME ON CUR_SOFTWARE_OPERATION_MODE 
BEGIN
    insert into HIS_SOFTWARE_OPERATION_MODE 
    select CUR_SOFTWARE_OPERATION_MODE.*, systimestamp as "HISTORY_TIME" from CUR_SOFTWARE_OPERATION_MODE where end_time is not null;
    delete CUR_SOFTWARE_OPERATION_MODE where end_time is not null;
END;
/
ALTER TRIGGER "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" ENABLE;
