-20535 THE DATA CHANGE OPERATION operation IS NOT SUPPORTED FOR THE TARGET OBJECT object-name BECAUSE OF AN IMPLICIT OR EXPLICIT SYSTEM PERIOD SPECIFICATION INVOLVING period-name. REASON CODE: reason-code.

Explanation

Db2 cannot perform the specified data change operation, because the target of the operation references a temporal table for which a period specification is in effect. The period specification was either implicitly specified by a special register or explicitly specified in the fullselect that was specified as the target.

operation
The data change operation.
object-name
The name of the target object.
period-name
The name of the period that is invalid. Possible values are BUSINESS_TIME or SYSTEM_TIME.
reason-code
A numeric value that indicates why the operation is invalid. reason-code can have one of the following values:
1
The data in a system-period temporal table cannot be changed when a period specification is in effect. In this case, this restriction was violated, because both of the following conditions exist:
  • The data change operation directly or indirectly references a system-period temporal table. The target of the operation is one of the following objects:
    • A system period temporal table
    • A view that is defined with an outer fullselect that either directly or indirectly references a system-period temporal table in the FROM clause
  • A period specification is in effect, because the CURRENT TEMPORAL SYSTEM_TIME special register contains a non-null value, and the SYSTIMESENSITIVE bind option is set to YES.

System action

The statement cannot be processed.

User response

Take the action for the specified reason code:

1
Take one of the following actions:
  • Set the CURRENT TEMPORAL SYSTEM_TIME special register to the null value and try the data change operation again.
  • If the statement is in a package that you do not want to be affected by the setting of the CURRENT TEMPORAL SYSTEM_TIME special register, bind the package with SYSTIMESENSITIVE NO.

SQLSTATE

51046