![]() |
Db2 command line output with printed SQLCA |
Communication Area overview
The SQLCA is present across the Db2 platforms:
- Docs for the Db2 Communications Area (Db2 LUW)
- Docs for the SQLCA in Db2 for z/OS
- Docs for the SQLCA in Db2 on IBM i (Db2 for i)
The structure consists of several fields that hold the product identifier, error code and state, error message and more. See the above links for details. Noteworthy are the field descriptions in the Db2 for i documentation because they include the list of product identifiers which are passed in the field SQLERRP. It is a CHAR(8)-sized field and the first three characters identify the product:
- ARI for Db2 for VM and VSE
- DSN for Db2 for z/OS
- QSQ for Db2 for i
- SQL for all other Db2 products
The Db2 LUW docs specify what follows after the "SQL", namely the SQLvvrrm with two characters for the version, two for the release and one for the modification. That information is returned when connecting to the database (see screenshot above). In my case I am on Db2 v12.1.1 (SQL12011). Some of the other fields have additional information on CONNECT. An example is SQLWARN7 which contains a "B" when successfully connected to BigSQL or "D" for Db2 Warehouse on Cloud.