DB2 Error Code – -906 the sql statement cannot be executed because this function is disabled due to a prior error

In this post, you’ll learn about the error message -906 the sql statement cannot be executed because this function is disabled due to a prior error in the IBM DB2 database , the reason why it occurs along with the solution to fix it

IBM DB2 Error Message

-906 the sql statement cannot be executed because this function is disabled due to a prior error

Reason for the Error

Execution of the SQL statement failed because the requested function had been disabled by a prior error.� This situation can arise if the application program has intercepted an abend (for instance, by an ON ERROR condition in a PL/I program) and continued to execute SQL statements.� This situation may also arise if a DB2 CICS transaction encountered a create thread error yet continued to issue SQL requests without issuing a SYNCPOINT ROLLBACK first.

Solution

In general, an application program should terminate upon receipt of this return code.� All subsequent attempts by the application to execute other SQL statements will also fail with the same return code.� In the case of a DB2 CICS transaction, if the SQLERRP field in the SQLCA contains the module name DSNCEXT1, the transaction may issue a SYNCPOINT ROLLBACK and continue processing.� If the transactions chooses to ROLLBACK and continue processing, it must be capable of correcting the situation that caused the create thread error to occur originally.