web stats
sql destination update - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2014, 05:57 AM
kiowa kiowa is offline
What's HL7?
 
Join Date: Sep 2014
Posts: 2
kiowa is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 09-23-2014, 08:12 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 09-24-2014, 02:25 AM
kiowa kiowa is offline
What's HL7?
 
Join Date: Sep 2014
Posts: 2
kiowa is on a distinguished road
Default

Actually I tried that as well without any luck. With the quotes was just my last iteration over the problem.
Reply With Quote
  #4  
Old 09-24-2014, 07:28 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

Quote:
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.
Reply With Quote
Reply

Tags
sql

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:58 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation