Hi Everyone!!
I am querying a SQL table to return an integer value if the query returns any results.
This is the SQL:
This is the filter I am using in Mirth to discard any messages not containing any keywords returned by my query
The error I get is :
DETAILS: Wrapped java.sql.SQLException: The executeQuery method must return a result set.
Question is: What is it that I am doing wrong and where can I find the definition of the the method executeCachedQuery. Also if there are any more methods which deal with SQL queries in Mirth but are not present in the references, any info on them would be appreciated!!!
Thanks!!!
I am querying a SQL table to return an integer value if the query returns any results.
This is the SQL:
Code:
ALTER PROCEDURE [dbo].[usp_searchkeyword2] @variable varchar(50), @keywdID int AS SET @keywdID = (Select keywordID from keywords where keyword LIKE @variable) Return @keywdID
Code:
var searchTerm = $('PV_AdmitReason'); //var query = "Declare @return_value int exec @return_value = usp_searchkeyword2 @variable = '" +searchTerm+ "', @keywdID = NULL Select @return_value"; var query = "exec usp_searchkeyword2 @variable = '" +search+ "', @keywdID = NULL"; var dbConn = DatabaseConnectionFactory.createDatabaseConnection('net.sourceforge.jtds.jdbc.Driver', 'jdbc:jtds:«»sqlserver://sqlserver:1433/database', 'user', 'password'); var result = 0; result = dbConn.executeCachedQuery(query); dbConn.close(); if (result >= 1){ return true; } else {return false;}
DETAILS: Wrapped java.sql.SQLException: The executeQuery method must return a result set.
Question is: What is it that I am doing wrong and where can I find the definition of the the method executeCachedQuery. Also if there are any more methods which deal with SQL queries in Mirth but are not present in the references, any info on them would be appreciated!!!
Thanks!!!
Comment