I'm doing a File Reader to Database Writer. I placed this code in the Edit filter page. Is it right?? By the way, what will I put on the Sql/Javascript part?? Thanks!!
-----------------------------------------------
But I received this error, patient_id is my table name
ERROR-200: Filter error
ERROR MESSAGE: Error evaluating filter
org.mozilla.javascript.WrappedException: Wrapped java.sql.SQLException: Invalid object name 'patient_id'. (0a0b339f-82bf-4d94-974f-7be2a41cb51d#20)
Post edited by: chrisl, at: 04/25/2007 00:17

Code:
var driver = "net.sourceforge.jtds.jdbc.Driver"; var address = "jdbc:jtds:«»sqlserver://saleslip2k/mirthdb"; var username = "sa"; var password = "cardtech"; //DatabaseConnection var dbConn = DatabaseConnectionFactory.createDatabaseConnection(driver, address, username, password); var patId = msg['PID']['PIaD.2']['CX.1']; var expression = "INSERT IGNORE INTO patient_id values ('" + patId + "');"; var result = dbConn.executeUpdate(expression); //closes the connection to the DB dbConn.close(); //finally you can return whatever you want to do with your filter. return true;
But I received this error, patient_id is my table name
ERROR-200: Filter error
ERROR MESSAGE: Error evaluating filter
org.mozilla.javascript.WrappedException: Wrapped java.sql.SQLException: Invalid object name 'patient_id'. (0a0b339f-82bf-4d94-974f-7be2a41cb51d#20)
Post edited by: chrisl, at: 04/25/2007 00:17
Comment