DB2 Version 9.7 for Linux, UNIX, and Windows

SET CURRENT REFRESH AGE statement

The SET CURRENT REFRESH AGE statement changes the value of the CURRENT REFRESH AGE special register. It is not under transaction control.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.

Authorization

None required.

Syntax

Read syntax diagramSkip visual syntax diagram
                             .-=-.                         
>>-SET--CURRENT REFRESH AGE--+---+--+-numeric-constant-+-------><
                                    +-ANY--------------+   
                                    '-host-variable----'   

Description

numeric-constant
A DECIMAL(20,6) value representing a timestamp duration. The value must be 0 or 99 999 999 999 999 (the microseconds portion of the value is ignored and can therefore be any value).
ANY
This is a shorthand for 99 999 999 999 999.
host-variable
A variable of type DECIMAL(20,6) or another type that is assignable to DECIMAL(20,6). It cannot be set to null. If host-variable has an associated indicator variable, the value of that indicator variable must not indicate a null value (SQLSTATE 42815). The value of host-variable must be 0 or 99 999 999 999 999.

Notes

Examples

Example 1: The following statement sets the CURRENT REFRESH AGE special register.
    SET CURRENT REFRESH AGE ANY
Example 2: The following example retrieves the value of the CURRENT REFRESH AGE special register into a host variable called CURMAXAGE. The value, set by the previous example, is 99999999999999.000000.
   EXEC SQL VALUES (CURRENT REFRESH AGE) INTO  :CURMAXAGE;