create or replace TRIGGER ERX.IB_NCPDP_MSG_HIST_INS_TRG
    AFTER INSERT ON ERX.INBOUND_NCPDP_MSG
    FOR EACH ROW
DECLARE rec INBOUND_NCPDP_MSG_HIST%ROWTYPE;
  blank INBOUND_NCPDP_MSG_HIST%ROWTYPE;
  BEGIN
    rec := blank;

      rec.INBOUND_NCPDP_MSG_ID   := :NEW.INBOUND_NCPDP_MSG_ID;
      rec.PATIENT_CHK_STATUS     := :NEW.PATIENT_CHK_STATUS;
      rec.PROVIDER_CHK_STATUS    := :NEW.PROVIDER_CHK_STATUS;
      rec.DRUG_CHK_STATUS        := :NEW.DRUG_CHK_STATUS;
      rec.MESSAGE_STATUS         := :NEW.MESSAGE_STATUS;
      rec.UPDATED_DATE           := :NEW.UPDATED_DATE;
      rec.CREATED_DATE           := :NEW.CREATED_DATE;

    INSERT INTO INBOUND_NCPDP_MSG_HIST VALUES rec;
  END; 
/


