Start of change

-798   A VALUE CANNOT BE SPECIFIED FOR COLUMN column-name WHICH IS DEFINED AS GENERATED ALWAYS

Explanation

When inserting or updating a row in a table, a value was specified for a column that is defined with GENERATED ALWAYS attributes, its value is not being set with the DEFAULT keyword, and:

  • Extended indicator variable values are not enabled.
  • Extended indicator variable values are enabled, but neither of the expected values DEFAULT (-5) or UNASSIGNED (-7) were provided.
column-name
The name of the column.

GENERATED ALWAYS columns should not be specified in the column list for an insert operation, or in the SET clause for an update operation unless the keyword DEFAULT is specified.

System action

The statement cannot be processed.

Programmer response

Remove the column from the column list or SET clause, or specify DEFAULT as the column value.

You can use the OVERRIDING USER VALUE clause on an INSERT statement as a possible solution for this situation.

SQLSTATE

428C9

End of change