CREATE OR REPLACE TRIGGER TRG_ATUALIZA_DTDISPONIBILIZAC
BEFORE INSERT ON TB_DJE_PREPUBLICACAO
FOR EACH ROW
WHEN (NEW.DT_DISPONIBILIZACAO IS NULL)
BEGIN
IF INSERTING THEN
:NEW.DT_DISPONIBILIZACAO := TO_DATE(sysdate || ' 20:00','DD/MM/RR HH24:MI');
END IF;
END;
/

1 Resposta
1

CREATE OR REPLACE TRIGGER TRG_ATUALIZA_DTDISPONIBILIZAC
BEFORE INSERT ON TB_DJE_PREPUBLICACAO
FOR EACH ROW
WHEN (NEW.DT_DISPONIBILIZACAO IS NULL)
BEGIN
IF INSERTING THEN
:NEW.DT_DISPONIBILIZACAO := (trunc(sysdate) + (20/24));
END IF;
END;