Troubleshooting
Problem
InfoSphere DataStage job fails on DB2 Connector stage with the error: SQL0302N The value of a host variable in the EXECUTE or OPEN statement is out of range for its corresponding use. Column type defined in DataStage job (eg. in Row Generator Stage) seems to be correct and corresponds to DB2 column type eg. Char or VarChar.
Symptom
Errors recorded in the InfoSphere DataStage job log:
[Input link 0] SQLExecute reported: SQLSTATE = 22001: Native Error Code = -302: Msg = [IBM]
[CLI Driver][DB2/LINUXX8664] SQL0302N The value of a host variable in the EXECUTE or OPEN
statement is out of range for its corresponding use. SQLSTATE=22001
(CC_DB2DBStatement::executeInsert, file CC_DB2DBStatement.cpp, line 1,096)
Message Id: IIS-CONN-DB2-00695
Message: DB2_Connector_0,1: [Input link 0] SQLExecute reported: SQLSTATE = 22001: Native
Error Code = -302: Msg = [IBM][CLI Driver][DB2/LINUXX8664] SQL0302N The value of a host
variable in the EXECUTE or OPEN statement is out of range for its corresponding use.
SQLSTATE=22001
Moreover the warning message similar to these can be recorded in the job log:
[IIS-CONN-DAAPI-000396] Writing the WCHAR column COL2 into a CHAR database column can cause data loss or corruption due to character set conversions.
[IIS-CONN-DAAPI-000393] The length of WCHAR column COL2 cannot be validated because the database column is CHAR and character set conversion is involved. Inadequate column lengths can lead to data truncation or unexpected errors.
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
25 April 2025
UID
swg21657647