CREATE OR REPLACE TRIGGER ERX.OB_NCPDP_MSG_INS_TRG 
    AFTER UPDATE ON ERX.OUTBOUND_NCPDP_MSG 
    FOR EACH ROW 
DECLARE rec OUTBOUND_NCPDP_MSG_HIST%ROWTYPE;
  blank OUTBOUND_NCPDP_MSG_HIST%ROWTYPE;
  BEGIN
    rec := blank;
    IF UPDATING THEN
      rec.OUTBOUND_NCPDP_MSG_ID   := :NEW.OUTBOUND_NCPDP_MSG_ID;
      rec.MESSAGE_STATUS         := :NEW.MESSAGE_STATUS;
      rec.UPDATED_DATE            := :NEW.UPDATED_DATE;
      rec.CREATED_DATE           := :NEW.CREATED_DATE;
    END IF;
    INSERT INTO OUTBOUND_NCPDP_MSG_HIST VALUES rec;
  END; 
/


