web stats
Javascript SQL Help - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-12-2014, 09:29 AM
anky2u anky2u is offline
Mirth Newb
 
Join Date: Dec 2013
Posts: 8
anky2u is on a distinguished road
Default Javascript SQL Help

Hi Experts ,

I am new to Mirth and was trying to create a Interface where we will take the data from the DB and create a delimited file for the patient estimates :

The SQL I am using is error-ed out , can you please let me know the correct syntax to join two tables in Mirth

var sql = " SELECT (837_claims_subscriber_new.subscriber_first_name) AS client_name ,"+
"LTRIM(RTRIM(subscriber_address_1)) AS client_address_1 ,"+
"LTRIM(RTRIM(subscriber_address_2)) AS client_address_2 ,"+
"LTRIM(RTRIM(subscriber_city)) AS client_city ,"+
"LTRIM(RTRIM(subscriber_state)) AS client_state ,"+
"LTRIM(RTRIM(subscriber_zip)) AS client_zip "+
"FROM 837_subscriber_add ";
"left join 837_claims_subscriber_new on 837_subscriber_add.claim_id=837_claims_subscriber_ new.claim_id ";
where updated='N'; ";

When I am running this the field "837_claims_subscriber_new.subscriber_first_na me" is taken as a field as a whole .

Please let me know the correct join statement I should use .

Thanks in Advance !
Anky
Reply With Quote
  #2  
Old 03-12-2014, 12:08 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,123
narupley is on a distinguished road
Default

What error are you getting? Have you tried it without the parentheses around "837_claims_subscriber_new.subscriber_first_na me"?
__________________
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
javascript, mirth, mssql

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 07:42 AM.


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