CREATE OR REPLACE TRIGGER USR_ALTERACAO_EXPORTAPEDOL
AFTER UPDATE OR INSERT OR DELETE ON ITEMPEDEXOL FOR EACH ROW
BEGIN
   IF INSERTING OR UPDATING THEN
      UPDATE PEDIDOEXOL
         SET USR_DTEXPORTA = NULL
       WHERE CDFILDEST = :NEW.CDFILDEST
         AND CDFILLANC = :NEW.CDFILLANC
         AND NRPEDEXOL = :NEW.NRPEDEXOL;
   END IF;
   IF DELETING THEN
      UPDATE PEDIDOEXOL
         SET USR_DTEXPORTA = NULL
       WHERE CDFILDEST = :OLD.CDFILDEST
         AND CDFILLANC = :OLD.CDFILLANC
         AND NRPEDEXOL = :OLD.NRPEDEXOL;
   END IF;
END;
/

-- VERSAO --
BEGIN ATUVEROBJ('USR_ALTERACAO_EXPORTAPEDOL','5.09.000'); END;
/
