Insert into sql DB without overwriting

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Insert into sql DB without overwriting

  • Creator
    Topic
  • #55736
    shikher arya1
    Participant

      I have a new requirement for my interface as follows:

      I have a CSV batch file which will have multiple records for an MRN.

      For ex:

      |1|2018-05-30 11:31:22|K40.20||K40|2||MRN-1

      |2|2018-05-30 11:31:22|Z41.2||Z41|2||MRN-1

      I am using an iterate in my xlate which means each CSV record will go one by one to Outbound DB.

      In the OB thread, there is a stored procedure created which is having delete records from DB based on the MRN & insert current records.

      Now, the requirement is that, I need to delete all the existing records from the DB based on the MRN-1 & insert whatever new record comes in the CSV file for that MRN-1 even if it is more than one. In the above ex: I want both records in the DB to exist.

      But, since, due to iterate, each record is going one by one, it is not inserting multiple records for the MRN-1, but overwriting it.

    Viewing 0 reply threads
    • Author
      Replies
      • #86348
        Daniel Murphy
        Participant

          I think you may want to delete the records based upon the date in addition to the MRN-1.

          Any record that is OLDER than 2018-05-30 will be removed but leaves the current date.

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.