Troubleshooting
Problem
DataStage job with ODBC driver reading from SQL Server table where the table name is a subset of any column name in that table, the query fails with several errors: DSD.BCIOpenWcall to function SQLPrepare failed, SQLSTATE=S0022, DBMS.CODE=207 SQLSTATE=37000, DBMS.CODE=8180 Statement(s) could not be prepared.
Symptom
DataStage job with ODBC driver reading from SQL Server table fails with errors:
CatDesc..Transformer_2: CatDesc..Cat_Desc_SQL.DSLink8: DSD.BCIOpenWcall to function SQLPrepare failed.
SELECT DTCCATNO,DTCCATDESCFROM CATDESC SQLSTATE=S0022, DBMS.CODE=207
[DataStage][SQL Client][ODBC][Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'DTCCATNO'. SQLSTATE=S0022, DBMS.CODE=207
[DataStage][SQL Client][ODBC][Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'DTCCATDESCFROM'. SQLSTATE=37000, DBMS.CODE=8180
[DataStage][SQL Client][ODBC][Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.
Error occurs when table name (i.e. CATDESC) is a subset of a column name (i.e. DTCCATDESC).
Resolving The Problem
This error is the result of a parsing problem which occurs when table name is a subset of a column name in the same table.
This issue can be bypassed using any of the following 3 methods:
- Add schema to table name in stage properties field for table name.
- Change table name in stage definition to lowercase (if table name is lowercase and column name is uppercase, the problem does not occur).
- Modify original table so that the table name is not used as part of any column name within the same table.
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21687787