sysVar.sqlca
The system variable sysVar.sqlca contains the entire SQL communication area (SQLCA). As noted later, the current values of a subset of fields in the SQLCA are available to you after your code accesses a relational database.
You can use sysVar.sqlca in these ways:
- As the source in an assignment or move statement
- As a variable in a logical expression
- As the argument in an exit or return statement
In order to refer to specific fields in the SQLCA, move sysVar.sqlca to a base record. The record must have a structure as specified in the SQLCA description for your database management system. Use the base record if you pass the SQLCA contents to a remote program so that the contents will be converted correctly to the remote system data format.
For specific information about the fields that are available in sysVar.sqlca, refer to the following topics:
- sysVar.sqlerrd
- sysVar.sqlcode
- sysVar.sqlState
- sysVar.sqlwarn
The characteristics of sysVar.sqlca are as follows:
- Primitive type
- HEX
- Data length
- 272 (136 bytes)
- Is value always restored after a converse?
- Only in a non-segmented text program; for details see Segmentation
Example
myItem = sysVar.sqlca;
Related concepts
Segmentation in text applications
SQL support
Related reference
File and database (system words)
sysVar.sqlcode
sysVar.sqlerrd
sysVar.sqlState
sysVar.sqlwarn