from Insert statement: The column index is out of range: 17, number of columns: 16.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

from Insert statement: The column index is out of range: 17, number of columns: 16.

George.Francis
I am getting the error:
"The column index is out of range: 17, number of columns: 16."
when I execute a mapped INSERT statement from my DAO, even though the statement does not select any columns, and executes just fine when run via pgAdmin.
Could there be an implicit selection being done by iBatis?  How could this be omitted?  Full trace:

Sep 2010 16:36:00,609 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
org.postgresql.util.PSQLException: The column index is out of range: 17, number of columns: 16.
        at org.postgresql.core.v3.CompositeParameterList.findSubParam(CompositeParameterList.java:37)
        at org.postgresql.core.v3.CompositeParameterList.setLiteralParameter(CompositeParameterList.java:74)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.bindLiteral(AbstractJdbc2Statement.java:2066)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.setInt(AbstractJdbc2Statement.java:1114)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:120)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:120)
        at com.ibatis.sqlmap.engine.type.IntegerTypeHandler.setParameter(IntegerTypeHandler.java:30)
        at com.ibatis.sqlmap.engine.type.UnknownTypeHandler.setParameter(UnknownTypeHandler.java:69)
        at com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap.setParameter(ParameterMap.java:166)
        at com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap.setParameters(ParameterMap.java:126)
        at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:78)
        at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
        at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
        at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
        at org.springframework.orm.ibatis.SqlMapClientTemplate$9.doInSqlMapClient(SqlMapClientTemplate.java:399)
        at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209)
        at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:397)
        at com.mycompany.enterprise.domain.dao.PcmDAOImpl.finaliseForMonth(PcmDAOImpl.java:59)