Announcement

Collapse
No announcement yet.

Excel Import After downloading file

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

  • Excel Import After downloading file

    I am building a channel, that basically gets an excel file from an SFTP server and imports this file into sql server.

    So here is what I have done so far:
    Source: Get Excel File from sftp server.
    Destination: Write Excel File to a Local Directory.

    This all works perfectly, now I need to execute a stored procedure to import the excel file into SQL. How can I do this?

    The stored procedure will delete the file after it has imported the file as well.

    I wanted to see if I can use the Postprocessor to do this, basically after the file has been written in the destination directory, I want to run a stored procedure and pass a variable with the filename into it. I am not sure how to do this though?

    If anyone else any better ideas, let me know.

    The excel file is an export of patient information that we will be getting from clients.

    Thanks.

  • #2
    You don't necessarily have to use a postprocessor to do that. Instead, you can just use a subsequent Database Writer destination.
    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
      So if I run the Database writer right after the first destination, will it run at the same time as the first destination or after the first destination? The reason I am asking is when I run the database writer, I don't want the file to not be there.

      Comment


      • #4
        Originally posted by rpatel View Post
        So if I run the Database writer right after the first destination, will it run at the same time as the first destination or after the first destination? The reason I am asking is when I run the database writer, I don't want the file to not be there.
        If the first destination is not queuing and is in the same chain (i.e. Wait for previous destination is checked) then yes, the second destination will only execute after the first finishes. You can also place a filter on your second destination and check the status of the previous destination, and only allow the message to be sent if the previous status is SENT (otherwise filter it).
        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


        • #5
          I didn't see that, that worked, thank you!!!

          Comment

          Working...
          X