Consultor Eletrônico



Kbase 19462: SQL data type out of range inserting into 9.1A date field
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/28/2000
SQL data type out of range inserting into Progress 9.1A database
date field over ODBC

Inserting a Null value into a date field using a the java
PreparedStatement.setNull(int parameterIndex, int sqlType)
over the JDBC-ODBC bridge is causing error:

Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Driver Manager]
SQL data type out of range
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Compiled Code)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:4246)
at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterNull(JdbcOdbc.java:444)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setNull(JdbcOdbcPreparedState
ment.java:300)

The sqlType for a Progress database date field is 91 and the possible range of tested Microsoft ODBC Driver Manager version 3.510.4202.0 is below that number.
The problem not only appears with Progress version 9.x and it was also possible to reproduce it with an Oracle database and different ODBC drivers.
Microsoft states in it's knowledge base at :

http://support.microsoft.com/support/kb/articles/Q149/6/44.asp?LNG=ENG&SA=ALLKB

BUG#: 14757

where a similar problem appeared with SQL Server.

Solution:
The same PreparedStatement works fine using the native
com.progress.sql.jdbc.JdbcProgressDriver coming with the 9.1A product.