on 11-11-2010 1:05 PM
Hi!
My JDBC sender adapter towards MS SQL server works fine, with an Execute statement calling a stored procedure that returns the source data needed. The stored procedure itself updates the status of database table records, so that only the unread records are returned each time the stored procedure is called.
However, the communication channel monitoring sets a red flag for the JDBC sender adapter, when there are no values to fetch from the database table (using the stored procedure). Message says: "Database-level error reported by JDBC driver while executing statement 'EXECUTE FetchMessage 1, 9000'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor."
This is not an error situation, as I do not expect there to be any values to fetch from the database at all times.
I do not see how to change the stored procedure to avoid this error.
Is there a parameter to be set on the JDBC adapter that I can use, so the red flag is avoided?
Thanks for any input!
Regards,
Oeystein Emhjellen
Hi Oeystein Emhjellen.
The problem is Store Procedure that has to generate always a ResultSet (or cursor). If it doesn't have a output, you have to generate an Empty ResultSet.
Like a SELECT Statement:
If there are data, SELECT get an output result but if it get nothing the SELECT Statement get a empty ResultSet.
Ask to your database team.
I hope it helps you.
Bruno.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your input!
I asked the creator of the stored procedure to produce an empty resultset if no records are available, and that did the trick!
Problem solved, no more error message from the jdbc adapter!
Regards,
Oeystein
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can your stored procedure give an empty answer if no result?
and check if you deploed all files for MSSQL JDBC driver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did you manage to resolve this problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.