COBOL DB2 Program Behavior on Host Variable and Column Mismatch



In case there is a mismatch in the number of columns and number of host variables,the query will fail. There are two ways in which we can detect this condition.

  1. The SQLWARN3 field of SQLCA will get the value as ‘W’ in case there is a mismatch.

  2. In some installations the SQLCODE field for SQLCA gets the error code as -804 when there is a mismatch.

We can use IF condition to check the value in SQLWARN3 or SQLCODE and direct the program processing accordingly.

Updated on: 2020-09-14T14:44:03+05:30

651 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements