-740 FUNCTION name IS DEFINED WITH THE OPTION MODIFIES SQL DATA WHICH IS NOT VALID IN THE CONTEXT IN WHICH IT WAS INVOKED

Explanation

A user-defined function that is defined with the MODIFIES SQL DATA clause was invoked in an invalid context.

name
The name of the user-defined function.
A user-defined function that is defined with MODIFIES SQL DATA is only allowed in a:
  • VALUES clause of an insert operation
  • SET clause of an update operation
  • VALUES statement in a trigger
  • SET assignment statement
  • CALL procedure statement
  • Start of changesubselectEnd of change

System action

The SQL statement failed.

Programmer response

Remove the user-defined function from the failing statement, or remove the MODIFIES SQL DATA option from the definition of the function.

SQLSTATE

51034