CREATE OR REPLACE TRIGGER
TR_JY_WJZTX0_AUPD_TIME
 BEFORE 
 INSERT OR UPDATE OF BJSJ00, ANJSSJ, QRSJ00, ANCLSJ
 ON SD_JY.JY_WJZTX0
 REFERENCING OLD AS OLD NEW AS NEW
 FOR EACH ROW 
declare
-- MODIFICATION HISTORY
   val DATE;
-- Person      Date        Comments
-- caishb      2022.01.21   create for ZYDZBL-20220117-002;
begin
  begin
   val :=TO_DATE(:New.ANJSSJ, 'yyyy-MM-dd HH24:mi:ss');
  exception
     when others then
     select to_char(sysdate,'HH24:mi:ss') into :New.Anjssj from dual;
  end;
  /*
  begin
   val :=TO_DATE(:New.Bjsj00, 'yyyy-MM-dd HH24:mi:ss');
  exception
     when others then
     select to_char(sysdate,'HH24:mi:ss') into :New.Bjsj00 from dual;
  end;   */
  
  begin
   val :=TO_DATE(:New.QRSJ00, 'yyyy-MM-dd HH24:mi:ss');
  exception
     when others then
     select to_char(sysdate,'HH24:mi:ss') into :New.QRSJ00 from dual;
  end;
  
  begin
   val :=TO_DATE(:New.ANCLSJ, 'yyyy-MM-dd HH24:mi:ss');
  exception
     when others then
     select to_char(sysdate,'HH24:mi:ss') into :New.ANCLSJ from dual;
  end;
end;
