Start of change

-20524   INVALID PERIOD SPECIFICATION OR PERIOD CLAUSE FOR PERIOD period-name. REASON CODE = reason-code.

Explanation

A period specification or period clause is invalid.

period-name
The period that is invalid.
reason-code
A numeric value that indicates why the period is invalid:
1
The period name was specified more than one time for the table reference.
2
The SYSTEM_TIME period was specified, but the table is not a system-period temporal table.
3
period-name violated the following requirement: each expression must return a value of a built-in data type and can contain any of the following supported operands:
  • A constant
  • A special register
  • A variable, which can be either a host variable, an SQL variable, an SQL parameter, or a transition variable
  • A parameter marker
  • A CAST specification, where the cast operand is a supported operand
  • An expression that uses arithmetic operators and operands
  • A scalar function whose arguments are supported operands (Nested function invocations are not permitted.)
4
The period specification or period clause was specified for a view.
5
The precision of an expression must be greater than the precision of the columns of the period. If the expression is a string, it is first converted to a timestamp, and the value must not contain more significant fractional seconds digits than the precision of the column.
8
The period specification or period clause was specified for a table that is not an application-period temporal table.
9
An expression must not return a value with a time zone if the begin and end columns of the specified period are defined as timestamp without time zone.

System action

The statement cannot be processed.

User response

Correct the syntax and resubmit the statement.

SQLSTATE

428HY

End of change