The GET DIAGNOSTICS statement
This section briefly summarizes how to use the GET DIAGNOSTICS statement within the program. For a full description of the GET DIAGNOSTICS statement, see the HCL OneDB™ Guide to SQL: Syntax.
The GET DIAGNOSTICS statement returns information that is held in the fields of the diagnostics area. The diagnostics area is an internal structure that the database server updates after it executes an SQL statement. Each application has one diagnostics area. Although GET DIAGNOSTICS accesses the diagnostics area, it never changes the contents of this area.
:host_var = FIELD_NAME
Make sure that the data types of the host variable and the diagnostics field are compatible.
- Statement information describes the overall result of the SQL statement, in particular the number of rows that it has modified and the number of exceptions that result.
- Exception information describes individual exceptions that result from the SQL statement.