Tuesday, September 29, 2015

DbAdapter - RowSet Column Type Mismatch Error

Problem: 
Invoking an SQL Server stored procedure with the Db Adapter would return the following error:

JCA Binding execute of Reference operation 'dbGetPromotions' failed due to: RowSet Column Type Mismatch Error. The SQL type in the XSD (INT) does not match the SQL type in the RowSet (int identity) for column ReservationID of parameter RowSet0.

This would happen when the DB Adapter would try to return the Output Parameters for the dbGetPromotions operation.

Solution:
Fix the XSD that was generated during the DB Adapter Wizard.

Originally, the XSD had been generated like this:

  <element name="ReservationID" type="int" db:type="INT" minOccurs="0" nillable="true"/>  

However, apparently the db:type needed for the element ReservationID needed to be int identity, so I changed it as follows:

 <element name="ReservationID" type="int" db:type="INT IDENTITY" minOccurs="0" nillable="true"/>  

Usually the same error will tell you what you need to change the db:type to, so just change it accordingly and you're ready to go!

2 comments:

  1. Was this exception you received was while calling the store proc from MS SQL ??

    Currently we are on SOA 12.2.1.2 version..

    ReplyDelete
    Replies
    1. Hi, Sabir, I would receive this error while calling a stored procedure from Microsoft SQL Server. We were using SOA 11g at the time. :)

      Delete