Start of change

-20491   INVALID SPECIFICATION OF PERIOD period-name. REASON CODE = reason-code.

Explanation

The specification of an attribute in a CREATE or ALTER statement for a period is invalid.

period-name
The period that contains the invalid specification.
reason-code
A numeric value that indicates why the attribute might be invalid:
1
The start column name must not be the same as the end column name for the period.
2
The name of a column in a period must not be the same as a column used in the definition of another period for the table.
3
The data type, length, precision, and scale for the start column must be the same as for the end column.
5
For a BUSINESS_TIME period, the column must not be a column defined with a GENERATED clause.
6
For a SYSTEM_TIME period, the attributes of the start column and end column must be one of the combinations:
  • The start column definition is GENERATED ALWAYS AS ROW BEGIN and the end column definition is GENERATED ALWAYS AS ROW END.
  • The start column definition is GENERATED BY DEFAULT AS ROW BEGIN and the end column definition is GENERATED BY DEFAULT AS ROW END.

System action

The statement cannot be processed.

User response

Correct the syntax, and resubmit the statement.

SQLSTATE

428HN

End of change