Start of change

-20490   A VERSIONING CLAUSE WAS SPECIFIED FOR TABLE table-name, BUT THE TABLE CANNOT BE USED AS A SYSTEM PERIOD TEMPORAL TABLE. REASON CODE = reason-code.

Explanation

The ALTER TABLE statement attempted to make the table into a system-period temporal table, but the table definition is not valid.

table-name
The name of the table.
reason-code
The reason for the message or SQL code, indicated by one of the following values:
1
The table is already defined as a system-period temporal table or history table.
2
The table does not have a SYSTEM_TIME period or a transaction start ID column. A system-period temporal table must have both a SYSTEM_TIME period and a transaction start ID column.
3
The table is a materialized query table.
5
The transaction-start-ID column must be defined with the same data type, length, precision, and scale as the row-begin column and row-end column of the SYSTEM_TIME period in the table.

System action

The statement cannot be processed.

User response

Correct the syntax, and resubmit the statement.

SQLSTATE

428HM

End of change