IBM Support

What Decides Whether One Receives SQLSTATE 01503 or SQLCODE-117?

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.

[{"Product":{"code":"SWG90","label":"z\/OS"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Not Applicable","Platform":[{"code":"","label":"MVS\/ESA"},{"code":"","label":"OS\/390"}],"Version":"1.8;1.9","Edition":"","Line of Business":{"code":"LOB56","label":"Z HW"}},{"Product":{"code":"SSEPEK","label":"Db2 for z\/OS"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Application Programming","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"11.0;12.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
03 September 2021

UID

isg3T1012004