SET CURRENT TEMPORAL BUSINESS_TIME statement

The SET CURRENT TEMPORAL BUSINESS_TIME statement changes the value of the CURRENT TEMPORAL BUSINESS_TIME special register.

Invocation

This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared.

Authorization

None required.

Syntax

Read syntax diagramSkip visual syntax diagramSET CURRENT TEMPORAL BUSINESS_TIME= NULLexpression

Description

NULL
Specifies the null value.
expression
Each expression can contain any of the following supported operands (SQLSTATE 428HY):
  • Constant
  • Special register
  • Variable. For details, refer to References to variables.
  • Built-in scalar function whose arguments are supported operands. User-defined functions and non-deterministic functions are not supported in this context.
  • CAST specification where the cast operand is a supported operand
  • Expression using arithmetic operator and operands

Notes

  • Transaction considerations: The SET CURRENT TEMPORAL BUSINESS_TIME statement is not a committable operation. ROLLBACK has no effect on CURRENT TEMPORAL BUSINESS_TIME.
  • Effects on other special registers: The setting of the CURRENT TEMPORAL BUSINESS_TIME special register does not have any effect on the values of other special registers, specifically the CURRENT DATE and CURRENT TIMESTAMP special registers.

Examples

  • Example 1:  Set the CURRENT TEMPORAL BUSINESS_TIME special register to the previous month.
       SET CURRENT TEMPORAL BUSINESS_TIME = CURRENT TIMESTAMP - 1 MONTH
  • Example 2:  Set the CURRENT TEMPORAL BUSINESS_TIME special register to the null value.
       SET CURRENT TEMPORAL BUSINESS_TIME = NULL