IBM Support

InfoSphere DataStage job fails on DB2 Connector with the error SQL0302N The value of a host variable in the EXECUTE or OPEN statement is out of range for its corresponding use

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.

[{"Product":{"code":"SSVSEF","label":"IBM InfoSphere DataStage"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.7","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
25 April 2025

UID

swg21657647