SQLCA is called as a SQL communication Area.
SQLCA will have all the information like return code, error id, error details etc,. after the DB2 query execution.
SQLCA needs to be included in the COBOL + db2 program which will act as a communication area between COBOL and DB2 to validate the SQLs execution.
The major fields which are used in the program is SQLCODE, SQLERRD (3) among all.
SQLCODE is used to validate the return code of the particular execution once the SQL execution completed.
SQLCODE validation can be done like below.
If SQLCODE is ZERO, then the query executed successfully.
If SQLCODE is +ve, then the query executed successfully but there was a warning.
If SQLCODE is –ve, then the query executed with some errors.
SQLERRD (3) contains the number of rows executed by the particular operation.
The length of the SQLCA is 136.
The below are the SQLCA fields with the data type and length.
DB2 Host Variables DB2 CURSOR