There are two ways to declare the SQL communication area (SQLCA):
EXEC SQL INCLUDE SQLCA
The preprocessor replaces this with a declaration of the SQLCA structure.
Figure 103. SQLCA Structure (in Assembler)
SQLCA DS 0F SQLCAID DS CL8 SQLCABC DS F SQLCODE DS F SQLERRM DS H,CL70 SQLERRP DS CL8 SQLERRD DS 6F SQLWARN DS 0C SQLWARN0 DS CL1 SQLWARN1 DS CL1 SQLWARN2 DS CL1 SQLWARN3 DS CL1 SQLWARN4 DS CL1 SQLWARN5 DS CL1 SQLWARN6 DS CL1 SQLWARN7 DS CL1 SQLWARN8 DS CL1 SQLWARN9 DS CL1 SQLWARNA DS CL1 SQLSTATE DS CL5 |
You must not declare the SQLCA within the SQL declare section. The meaning of the fields is explained in DB2 Server for VSE & VM SQL Reference manual.
You may find that the only variable in the SQLCA you really need is SQLCODE. If this is the case, declare just the SQLCODE variable, and invoke NOSQLCA support at preprocessor time.