cryptic error message: Length of Bind host variable exceeds MaxLength
- by janetsmith
Hi,
I've encountered a cryptic error message thrown by Sybase IQ server.
com.sybase.jdbc2.jdbc.SybSQLException: ASA Error -1001019: Function not supported on varchars longer than 255 Length of Bind host variable exceeds MaxLength ,
-- (df_Heap.cxx 2145)
at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2636)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1996)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:204)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:187)
at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1642)
at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:1625)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java:91)
at ibs.dao.CM3RM1DAO.updateToTable(CM3RM1DAO.java:197)
at ibs.dao.CM3RM1DAO.isXMLProcessed(CM3RM1DAO.java:88)
at ibs.xml.parser.XMLParser.parsingXMLIntoBO(XMLParser.java:2125)
at ibs.common.util.MainClass.main(MainClass.java:74)
We have several columns (DESCRIPTION etc.) which are of type varchar(4000). However I can update them directly without having any error. And, I don't see any code specifying any bind variables, so I have no idea where the message comes from.
This is the code (I've modified it a bit):
String sql = "UPDATE TABLEX SET " +
"COMPANY = ?, CUSTOMER_REFERENCE= ?, " +
"STATUS = ?, CONTACT_FIRST_NAME = ?, CONTACT_LAST_NAME = ?, " +
"SEVERITY = ?, PRIORITY_CODE = ?, REQUESTEDDATE = ?, " +
"CLOSE_TIME = ?, LEAD_TIME = ?, CHANGE_REASON = ?, MODTIME = ? WHERE NUMBER = ?";
stmt = conn.prepareStatement(sql);
for loop here
{
stmt.setString(...);
.
.
stmt.executeUpdate();
}
Any help is appreciated