b1nary0mega
4/25/2014 - 6:38 PM

Create a trigger to 'zero' the time part of a DATE data type.

Create a trigger to 'zero' the time part of a DATE data type.

create or replace TRIGGER "MEDSCHED".zero_profile_dates BEFORE
  INSERT OR
  UPDATE ON employee_profile FOR EACH ROW 
  BEGIN 
  :new.MSS_UNIT_STRT_DT := TRUNC(:new.MSS_UNIT_STRT_DT);
  :new.POS_STRT_DATE    := TRUNC(:new.POS_STRT_DATE);
  :new.UNIT_STRT_DATE   := TRUNC(:new.UNIT_STRT_DATE);
  :new.SMH_STRT_DT      := TRUNC(:new.SMH_STRT_DT);
  :new.MSS_UNIT_TERM_DT := TRUNC(:new.MSS_UNIT_TERM_DT);
  :new.SMH_TERM_DT      := TRUNC(:new.SMH_TERM_DT);
  :new.SIX_MO_CNCL_DT   := TRUNC(:new.SIX_MO_CNCL_DT);
END;