Start of change

-751   object-type object-name (SPECIFIC NAME specific name) ATTEMPTED TO EXECUTE AN SQL STATEMENT sql-statement THAT IS NOT ALLOWED

Explanation

A stored procedure or user-defined function attempted to execute an SQL statement that is not allowed.

object-type
The type of object:
Stored procedure
A stored procedure issued an SQL statement that forced the DB2® thread to roll back the unit of work. The SQL statement that caused the thread to be placed in the MUST_ROLLBACK state is either COMMIT or ROLLBACK:

All further SQL statements are rejected until the SQL application that issued the SQL CALL statement rolls back the unit of work. When control returns to the SQL application that issued the SQL CALL statement, the SQL application must roll back the unit of work. This can be done by issuing an SQL ROLLBACK statement or the equivalent IMS™ or CICS® operation.

User-defined function
The external function that is indicated by object-name issued either a COMMIT or ROLLBACK statement.
object-name
The name of the object.
specific-name
The specific function name, which is unique within the schema.
sql-statement
The SQL statement that was issued.

System action

The statement cannot be processed.

Programmer response

Either remove all COMMIT and ROLLBACK statements from the stored procedure, or modify the client application so that it establishes an environment that allows the stored procedure to execute statements. Remotely called stored procedures can execute embedded COMMIT or ROLLBACK statements if the following conditions are met:

  • The connection with the requester system must use one phase commit protocols.
  • The requester system must indicate that commits are allowed by sending a DRDA RDBCMTOK=TRUE indication when the stored procedure is called.

    For DB2 Connect™ requester systems, the client application must use either Connect Type 1 or Remote Unit of Work connections. Other connections cause DB2 Connect to indicate that commits are not allowed, which will cause COMMIT and ROLLBACK statements in a stored procedure to fail.

SQLSTATE

38003

2F003

End of change