Announcement

Collapse
No announcement yet.

Full message out to database using ODBC

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

  • Full message out to database using ODBC

    I am trying to take the full XML message generated by Mirth and put it into a memo field in a table.
    Code:
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('sun.jdbc.odbc.JdbcOdbcDriver','jdbc:odbc:IHEData','doug','doug');
    var datastuff = $(message.encodedData);
    var expression = "EXECUTE PROCEDURE UpdateTable('PATIENT','datastuff');";
    var result = dbConn.executeUpdate(expression);
    sends the text "datastuff" to the table (this was a test of the connection).
    Code:
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('sun.jdbc.odbc.JdbcOdbcDriver','jdbc:odbc:IHEData','doug','doug');
    var datastuff = $(message.encodedData);
    var expression = "EXECUTE PROCEDURE UpdateTable('PATIENT','"+datastuff+"')";
    var result = dbConn.executeUpdate(expression);
    Sends a null for the datastuff amount, as does
    Code:
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('sun.jdbc.odbc.JdbcOdbcDriver','jdbc:odbc:IHEData','doug','doug');
    var datastuff = $(message.encodedData).toString();
    var expression = "EXECUTE PROCEDURE UpdateTable('PATIENT','"+datastuff.toString()+"')";
    var result = dbConn.executeUpdate(expression);
    Similar results with an SQL Insert. Any ideas?

  • #2
    Re:Full message out to database using ODBC

    Tried this and I got the message in XML format.

    Code:
    var msgInXMLFormat = msg;
    logger.info('msgInXMLFormat is:' + msgInXMLFormat);
    Hope it helps!

    Comment

    Working...
    X