Question & Answer
Question
You find that when you have a mismatch between the variables provided and the actual column count, you receive either an SQLSTATE 01503 or an SQLCODE-117. What decides which one you receive?
Answer
You will get the SQLSTATE 01503 during a FETCH/VALUES INTO/SELECT INTO operation when there is a mismatch between the number of variables and the values in the row.
Here is the excerpt from the SQL REFERENCE for each of the above statements:
The value 'W' is assigned to the SQLWARN3 field of the SQLCA if the number of targets is less than the number of result column values.
The SQLCODE -117 is generated on an INSERT/SET operation when there is mismatch between the INSERT/SET values does not match with the corresponding object columns specified.
Was this topic helpful?
Document Information
Modified date:
03 September 2021
UID
isg3T1012004