Announcement

Collapse
No announcement yet.

Updating SQL DB from a CSV File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Updating SQL DB from a CSV File

    I'm quite new mirth

    I receive periodic data extract in the form of CSV containing multiple records that I want to update in a SQL table. I succeeded with single records, but don't know how to loop through multiple records in the CSV

    Please help.

  • #2
    Originally posted by arazak View Post
    I'm quite new mirth

    I receive periodic data extract in the form of CSV containing multiple records that I want to update in a SQL table. I succeeded with single records, but don't know how to loop through multiple records in the CSV

    Please help.
    You can do that in many ways. One way is to turn on batch processing (enable it in the Delimited Text settings, and set Process Batch: Yes on your File Reader), so that your channel handles every record as a discrete message and can perform a database update for each one with a Database Writer.

    Another way is just to read in the entire CSV as a single message, iterate through the rows/columns in JavaScript, and for each row (or however you want to do it) perform a manual database update. There are entries in the References tab to can help with connecting to databases and performing queries/updates.
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      Updating SQL DB from a CSV File

      Thanks narupley

      Apologies for the late response.

      resolved using javascript iteration
      Last edited by arazak; 09-26-2013, 02:36 AM.

      Comment

      Working...
      X