-20267 THE FUNCTION function-name (SPECIFIC specific-name) MODIFIES SQL DATA AND IS INVOKED IN AN ILLEGAL CONTEXT. REASON CODE reason-code
Explanation
The function is defined with the MODIFIES SQL DATA option. A function that is defined with
MODIFIES SQL DATA is only allowed in:
- VALUES clause of an insert operation
- SET clause of an update operation
- VALUES statement in a trigger
- SET assignment statement
- CALL procedure statement
- function-name
- The name of the function.
- specific-name
- The specific function name, which is unique within the schema.
- reason-code
- A numeric value that indicates the reason for the failure.
- 1
- The function is referenced in the DEFAULT clause of the definition of a global variable.
- 5
- The select list of a fullselect that contains an OFFSET clause.
System action
The statement cannot be processed.
Programmer response
Remove the reference to the function from the DEFAULT clause of the definition of the global variable.
SQLSTATE
429BL