C#更新数据库,触发器的适用范围

2025-03-10 23:41:48
推荐回答(1个)
回答1:

create or replace trigger A表_Upzh
before insert or update ON A表
FOR EACH ROW
DECLARE
BEGIN
    IF :new.stop_time is not null then

    :new.differ_time= ceil((:new.stop_time-:new.start_time)*24*60);
    end if;

END A表_Upzh;

 

先判断stop_time是否为空,如果不为空,则相减得出时间相差的分钟数