-150   THE OBJECT OF THE INSERT, DELETE, UPDATE, MERGE, OR TRUNCATE STATEMENT IS A VIEW, SYSTEM-MAINTAINED MATERIALIZED QUERY TABLE, OR TRANSITION TABLE FOR WHICH THE REQUESTED OPERATION IS NOT PERMITTED

Explanation

One of the following occurred:
  • A transition table was named in an INSERT, UPDATE, DELETE, MERGE, or TRUNCATE statement in a triggered action. Transition tables are read-only.
  • The view named in the INSERT, UPDATE, DELETE, MERGE, or TRUNCATE statement is defined in such a way that the requested insert, update, delete, or truncate operation cannot be performed upon it.
    Inserts into a view are prohibited if:
    • The view definition contains a join, a GROUP BY, or a HAVING clause.
    • The SELECT clause in the view definition contains the DISTINCT qualifier, an arithmetic expression, a string expression, a built-in function, or a constant.
    • Two or more columns of the view are derived from the same column.
    • A base table of the view contains a column that does not have a default value and is not included in the view.
    Updates to a view are prohibited if:
    • The view definition contains a join, a GROUP BY, or a HAVING clause.
    • The SELECT clause in the view definition contains the DISTINCT qualifier or a built-in function.

    Also, a given column in a view cannot be updated (that is, the values in that column cannot be updated) if the column is derived from an arithmetic expression, a constant, a column that is part of the key of a partitioned index, or a column of a catalog table that cannot be updated.

    Deletes against a view are prohibited if:
    • The view definition contains a join, a GROUP BY, or a HAVING clause.
    • The SELECT clause in the view definition contains the DISTINCT qualifier or a built-in function.

    Truncates against a view are always prohibited.

  • An auxiliary table or an XML table was named in a TRUNCATE statement.

System action

The statement cannot be processed. No data was inserted, updated, deleted, merged, or truncated.

User response

The requested function cannot be performed on the view.

If the error occurred on a CREATE TRIGGER statement, remove the INSERT, UPDATE, MERGE, or DELETE reference to the transition table.

SQLSTATE

42807