Announcement

Collapse
No announcement yet.

sql destination update

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

  • sql destination update

    Hi,

    I've been trying to use the database writer in a destination (d2) to update a table based on the response in the previous destination (d1).

    I've set up the variables that I need access to into the channelMap, and I do have access to them and they are set correctly.

    What I find interesting is that it works using Javascript:
    Code:
    var result = dbConn.executeUpdate("UPDATE patient_patient SET process_status = '"+$('ris_response')+"' WHERE id = "+$('patient_id'));
    But not using the sql syntax:
    Code:
    UPDATE patient_patient SET process_status = '${ris_response}' WHERE id = ${patient_id}
    Any ideas?

    I'm using Mirth 3.0.3

    Thanks,
    Alexander

  • #2
    When using SQL mode, you only need the ${varName} syntax, without quotes. Any strings will be placed in the resulting prepared statement, so you don't need to worry about including quotes.
    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
      Actually I tried that as well without any luck. With the quotes was just my last iteration over the problem.

      Comment


      • #4
        Originally posted by kiowa View Post
        Actually I tried that as well without any luck. With the quotes was just my last iteration over the problem.
        If you post the actual error stacktrace, it may give us more information.
        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

        Working...
        X