-577   object-type object-name ATTEMPTED TO MODIFY DATA WHEN THE DEFINITION OF THE FUNCTION OR PROCEDURE DID NOT SPECIFY THIS ACTION

Explanation

The current environment does not allow SQL statements that modify data. One of the following situations has occurred:
  • A user-defined function or stored procedure object-name was invoked and attempted to modify data, but the function or procedure was defined without the MODIFIES SQL option.
  • A user-defined function or stored procedure object-name was invoked and attempted to execute a data definition statement, but the function or procedure was defined without the MODIFIES SQL option.
  • A function or procedure defined with READS SQL DATA, CONTAINS SQL, or NO SQL has attempted to invoke another function or procedure defined with MODIFIES SQL DATA.
  • A user-defined function or stored procedure object-name was invoked and attempted to use a NEXT VALUE expression. However, the function or procedure was defined without the MODIFIES SQL DATA option.

In an environment of nested functions and procedures, the SQL option in effect is the most restrictive one that has been specified in the nested hierarchy of functions and procedures. The SQL data access option in effect does not allow for modifying the data.

System action

The statement cannot be processed.

Programmer response

Either use an ALTER statement to change the definition of the function or procedure to allow statements that modify data, or remove the failing SQL statement from the external function or procedure.

SQLSTATE

38002