Search code examples
sql-serverwso2sql-server-2014wso2-data-services-server

WSO2 DSS - SQLServerException: This operation is not supported


Currently using WSO2 DSS 3.5.0 to execute a stored procedure in MSSQL that does an insert in a transaction. The procedure responds with a return code and a return message. The DSS is able to execute the statement in the database as the new entries are added, but when i try to map the output of the procedure to the output of the DSS i get the following exception:

com.microsoft.sqlserver.jdbc.SQLServerException: This operation is not supported.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:191)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.NotImplemented(SQLServerStatement.java:613)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getMoreResults(SQLServerStatement.java:2374) ...

This is the statement i'm using:

DECLARE @returnCode int, @returnMessage varchar(255)

EXEC "dbo"."sp_insertExample" @ipFirstId = ?, @ipSecondId = ?, @opErrorCode = @returnCode output, @opErrorMesssage = @returnMessage output

SELECT @returnCode, @returnMessage  

The inputs are both int values.

Has it happen to somebody else, and do you know how to correct it or what i'm doing wrong?

Edit - Adding the mapping done between outputs:

<result element="result" escapeNonPrintableChar="true" rowName="Addition" useColumnNumbers="true">
    <element column="1" name="ReturnCode" xsdType="integer"/>
    <element column="2" name="ReturnMessage" xsdType="string"/>
</result>

Solution

  • So found out what was different between the stored procedures, basically there was a line missing from one that apparently was important, namely:

    SET NOCOUNT ON;
    

    In my case it was that, hope it helps someone else.