The diagnostics area consists of two subareas: the statement information and the condition information.
The statement information contains two values:
The diagnostics area is populated and emptied by following the exact rules. Knowing these rules is very important to debug single statements without falling for some common pitfalls, and it is more important to debug the stored programs.
Whenever a statement generates at least one condition (notes, warnings, or errors), the diagnostics area is populated with such conditions. Any condition present previously in the diagnostics area is deleted. However, there is an exception. If the new statement is RESIGNAL
or GET DIAGNOSTICS
, the old conditions are not deleted. This is to...