Empty/Null value update error if SQL Anywhere/ASE

If the Web application uses an SAP Adaptive Server Enterprise (ASE) database or a SQL Anywhere database that is set as ASE-compatible, database updates may fail.

Cause: If the length is 0 or the value of the data is NULL for any data in a database table where the data is of a string type, such as varchar or char data type, the data retrieved from the database through a JDBC driver will have a length greater than 0. Rather than a null value, the data returned will be padded with a series of spaces. As a result of this padding, the database update will fail.

Solution: You can work around this issue in one of two ways:

1. For SAP SQL Anywhere and ASE databases, we recommend that you do not use a Native-protocol/all-Java JDBC driver. There are a number of JDBC-ODBC bridge drivers that can be used, such as those from SUN or the iAnywhere driver. However, iAnywhere is one of the best performing and most stable bridge drivers available.

2. For SAP SQL Anywhere, if it is preferential to use a JDBC driver, you will need to adjust the database accordingly. Change the SQL Anywhere database setting so it is set to be incompatible with ASE.