Feedback
Did this article resolve your question/issue?

   

Article

"Datetime field overflow. Error in parameter x. {22008}" error with DB2 ODBC driver

« Go Back

Information

 
Title"Datetime field overflow. Error in parameter x. {22008}" error with DB2 ODBC driver
URL Name7529
Article Number000149206
EnvironmentProduct: Connect for ODBC DB2 driver
Version: 6.0 and later
OS: all supported platforms
Database: DB2
Application: all supported applications
Question/Problem Description
A parameterized timestamp insert fails using version 06.00.0197 or later, but is successful with build 06.00.0193.
Steps to Reproduce
Clarifying Information
1. Create the following table:

CREATE TABLE MYTABLE (TIMESTAMPCOL TIMESTAMP)

2. Insert the following value:

INSERT  INTO "MYTABLE" ("TIMESTAMPCOL") VALUES (?)

3.Bind the timestamp column as follows and execute the statement:

SQLBindParameter
 HSTMT               0x08b7aff8
 UWORD                        1
 SWORD                        1
 SWORD                       93
 SWORD                       93
 UDWORD                      19
 SWORD                        0
 PTR                 0x08b74ea0
 SDWORD                      16
 SQLLEN *            0x08b73e74

Error Message[DataDirect][ODBC DB2 Wire Protocol driver]Datetime field overflow. Error in parameter 1. {22008}
Defect Number
Enhancement Number
Cause
Column TIMESTAMPCOL was described with ColumnSize 26, but was incorrectly bound with ColumnSize 19.  The driver used to insert the data correctly in spite of the incorrect binding, but after the fix for defect DD00053825 in June, 2010, the driver enforces binding with the correct ColumnSize. This change will affect all drivers.
Resolution

Change the application to bind the timestamp with the correct ColumnSize.

Workaround

Set WorkArounds2=2 in the data source.

WorkArounds2=2. Enabling this option causes the driver to ignore the ColumnSize/DecimalDigits specified by the application and use the database defaults instead. Some applications incorrectly specify the ColumnSize/DecimalDigits when binding timestamp parameters.

Notes
Last Modified Date4/17/2019 4:46 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.