web stats
Mirth Community - View Single Post - Failed to write to database
View Single Post
  #1  
Old 10-28-2015, 06:16 PM
psanders psanders is offline
OBX.2 Kenobi
 
Join Date: Nov 2011
Posts: 55
psanders is on a distinguished road
Default Failed to write to database

Hi all,

I'm inserting an HL7 message into a SQL Server 11 table with the following columns and datatypes

MSG_ID INT
MSH10_ID varchar(50)
MESSAGE varchar(max)
INSERT_DT datetime

My SQL looks like this:

INSERT INTO QUEUE_HL7 (MSG_ID, MSH10_ID, MESSAGE, INSERT_DT)
VALUES (${message.messageId},${MSH10},${message.rawData}, ${DATE})

However, when I deploy the channel and start it, I get this error:

Database Writer error
ERROR MESSAGE: Failed to write to database
com.mirth.connect.connectors.jdbc.DatabaseDispatch erException: Failed to write to database
further in the log is this statement:
Caused by: java.sql.SQLException: Invalid parameter index 5.

I'm guessing that the parameter it doesn't like is the date variable, but could use some suggestions on this. Any thoughts?
Attached Files
File Type: xml TestChannelv2.xml (24.2 KB, 25 views)
Reply With Quote