10. A computer program product for controlling a dump for a database, the computer program product comprising: a non-transitory tangible storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising: in response to a structured query language (SQL) statement being executed for the database, determining a state of a diagnosis flag associated with the SQL statement, the diagnosis flag indicating whether to perform a dump; performing, by a computer, a dump for the SQL statement m response to determining that the diagnosis flag indicates that a dump is to be performed; and for each of one or more processing steps for the SQL statement: executing the processing step; determining the state of the diagnosis flag in response to executing the processing step; accessing dump configuration information associated with the processing step; and performing the dump for the processing step based on the dump configuration information, in response to the dump configuration information indicating a dump is to be performed.
10. A computer program product for controlling a dump for a database, the computer program product comprising: a non-transitory tangible storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising: in response to a structured query language (SQL) statement being executed for the database, determining a state of a diagnosis flag associated with the SQL statement, the diagnosis flag indicating whether to perform a dump; performing, by a computer, a dump for the SQL statement m response to determining that the diagnosis flag indicates that a dump is to be performed; and for each of one or more processing steps for the SQL statement: executing the processing step; determining the state of the diagnosis flag in response to executing the processing step; accessing dump configuration information associated with the processing step; and performing the dump for the processing step based on the dump configuration information, in response to the dump configuration information indicating a dump is to be performed. 13. The computer program product according to claim 10 , wherein the method further comprises clearing temporary data generated during the dump in response to completion of the dump for the SQL statement.