SQL diagnostic information
The database manager uses a diagnostics area to store status information and diagnostic information about the execution of an executable SQL statement. When an SQL statement other than GET DIAGNOSTICS or compound-statement is processed, the current diagnostics area is cleared, before processing the SQL statement. As each SQL statement is processed, information about the execution of that SQL statement is recorded in the current diagnostics area as one or more completion conditions or exception conditions.
A completion condition indicates the SQL statement completed
successfully, completed with a warning condition, or completed with
a not found condition. An exception condition indicates that the statement
was not successful. The GET DIAGNOSTICS statement can be used in most
languages to return conditions and other information about the previously
executed SQL statement from the diagnostics area. For more information,
see GET DIAGNOSTICS. Additionally, the condition
information is provided through language specific mechanisms:
- For SQL procedures, SQL functions, and SQL triggers, see SQL-procedure-statement.
- For host languages, see Detecting and processing error and warning conditions in host language applications.