REFRESH TABLE

The REFRESH TABLE statement refreshes the data in a materialized query table. The statement deletes all rows in the materialized query table and then inserts the result rows from the select-statement specified in the definition of the materialized query table.

Invocation

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

Authorization

The privileges held by the authorization ID of the statement must include at least one of the following:

For information on the system authorities corresponding to SQL privileges, see Corresponding System Authorities When Checking Privileges to a Table or View.

Syntax

Click to skip syntax diagram
Read syntax diagramSkip visual syntax diagram                  .-,--------------.
                  V                |
>>-REFRESH TABLE------table-name---+---------------------------><
 

Description

table-name
Identifies the materialized table to be refreshed. The table-name must identify a materialized query table that exists at the current server. REFRESH TABLE evaluates the select-statement in the definition of the materialized query table to refresh the table.

Notes

Refresh use of materialized query tables: No materialized query tables are used to evaluate the select-statement during the processing of REFRESH TABLE statement.

Refresh isolation level: The isolation level used to evaluate the select-statement is either:

Number of rows: After successful execution of a REFRESH TABLE statement, the ROW_COUNT statement information item in the SQL Diagnostics Area (or SQLERRD(3) in the SQLCA) will contain the number of rows inserted into the materialized query table.

Example

Refresh the data in the TRANSCOUNT materialized query table.

   REFRESH TABLE TRANSCOUNT


[ Top of Page | Previous Page | Next Page | Contents | Index ]