

SQL Concepts and Language Elements › SQLCA
SQLCA
The SQLCA is a work area that retrieves information about the last SQL statement processed, either embedded SQL or SQL generated by a FOR construct. You can access SQLCA fields in CA Ideal programs using the following functions:
- A series of $SQL built‑in functions. The $SQL built‑in functions return information about the last SQL statement processed in the application or run unit (that is, in the program and its subprograms). The data type the function returns is the same as the type of the associated field. For more information about $SQL functions, see the "Symbolic Debugger Commands" chapter.
- The $ERROR‑DVW‑STATUS function to return the SQLCODE. The $ERROR functions return information about the last SQL statement generated by a FOR construct in an Error Procedure or WHEN ERROR clause.
- A copy of the SQLCA in working data or parameter data. You can have a copy for each database with SQL access. Each consists of a single level‑1 group item for the SQLCA and subordinate items for the individual SQLCA fields. The SQLCA fields return information about the last SQL statement in the program (not subprograms) that the database processed. For example, if you have SQLCAs for DB2 and CA Datacom SQL access, the DB2 SQLCA only returns information about the last SQL statement DB2 processed. For more information, see the COPY SQLCA clause under Working Data or Parameter Data in the Creating Programs Guide.
In a non‑CICS environment, if a PDL CHECKPOINT or BACKOUT statement is executed and the database was accessed, then CA Ideal executes a SQL COMMIT or ROLLBACK, changing the contents of the SQLCA.
Copyright © 2015 CA Technologies.
All rights reserved.
 
|
|