CREATE OR REPLACE TRIGGER DTULTATU_COMBINAPROD
BEFORE INSERT OR DELETE OR UPDATE
ON COMBINAPROD FOR EACH ROW

BEGIN
   IF INSERTING THEN
      :NEW.DTULTATU := SYSDATE;
   END IF;
   IF UPDATING THEN
      :NEW.DTULTATU := SYSDATE;
   END IF;
   IF DELETING THEN
      INSERT INTO DELETECACHE (NMTABLECACHE, CDFILICACHE, DSKEYCACHE, DTULTATUCACH)
                       VALUES ('COMBINAPROD', '', 'CDCAMPPROMO='||:OLD.CDCAMPPROMO||';CDPRODPRIN='||:OLD.CDPRODPRIN||';CDPRODCOMB='||:OLD.CDPRODCOMB||';', SYSDATE);
   END IF;
END;
/

UPDATE COMBINAPROD SET DTULTATU = SYSDATE WHERE DTULTATU IS NULL
/

ALTER TABLE COMBINAPROD MODIFY DTULTATU DEFAULT SYSDATE
/

-- VERSAO --
BEGIN ATUVEROBJ('DTULTATU_COMBINAPROD','6.10.000'); END;
/