Hi,
 
I'm developing a call to an Stored Procedure with SQL SERVER, and when I try to map, it throws an SQL Exception
 
 
com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in com/hermes/persistence/sqlmapdao/sql/Accounts.xml. 
--- The error occurred while applying a parameter map. 
--- Check the Accounts.paramSearchAccountList. 
--- Check the statement (update procedure failed). 
--- Cause: java.sql.SQLException: Formal parameter '@Deleted' was defined as OUTPUT but the actual parameter not declared OUTPUT.
Caused by: java.sql.SQLException: Formal parameter '@Deleted' was defined as OUTPUT but the actual parameter not declared OUTPUT.
 
(also I got a SQLStatment 37000 :( )
 
the code is the following:
 
--------XML-------

<parameterMap id="paramSearchAccountList" class="java.util.HashMap" >
        <parameter property="clientName" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
        <parameter property="role" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
        <parameter property="VATNumber" jdbcType="VARCHAR" javaType=" java.lang.String" mode="IN"/>
        <parameter property="currency" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
        <parameter property="deleted" jdbcType="BIT" javaType=" java.lang.Integer" mode="INOUT"/>
        <parameter property="NumRecordsRetrieved" jdbcType="INTEGER" javaType="java.lang.Integer" mode="INOUT"/>
        <parameter property="list" jdbcType=" java.util.list" mode="OUT" resultMap="usu"/>
      <!--    <parameter property="list" jdbcType="INTEGER" mode="OUT" /> -->
   </parameterMap>

   <procedure  id="getAllAccounts" resultMap="accountsList" parameterMap="paramSearchAccountList">
      {
        call CPGHermesAccountsSearch (?, ?, ?, ?, ?, ?)
      }
   </procedure>

--------JAVA-------------

public PaginatedList getListAccounts(HashMap map) throws SQLException {
      PaginatedList list = null;
      try{
      //  list = sqlMap.queryForPaginatedList("Accounts." + GET_ALL + "Accounts", map, 1);
        list = (PaginatedList) sqlMap.queryForObject("Accounts." + GET_ALL + "Accounts", map);

      }
       catch (SQLException e) {
           throw (e);
         //   logger.error("Error getting departments", e);
       }
      return list;
  }

-----------------------
If I execute the SP in SQL Analyzer, it works fine, but with ibatis, there may be some missconfiguration with the parameters, does anybody knows what do I'm doing wrong?

Sincerely yours,
 
Miquel Angel

Reply via email to