SamRefreshView function
Syntax
SamRefreshView(matview_name, override_complete_refresh)
Description
Use the SamRefreshView function to refresh a materialized view based on its properties, such as Refresh Status, Refresh Mode, and Refresh Method.
-
If refresh status is set to 1 and refresh mode is set to ON DEMAND, then it will be a first refresh or complete refresh based on the refresh method property of the view.
-
If refresh status is set to 2 and the override_complete_refresh parameter is set to true, the materialized view is refreshed. If the override_complete_refresh parameter is set to false, the materialized view is not refreshed.
-
In all other cases, a complete refresh is performed if the override_complete_refresh parameter is set to true. If set to false, a complete refresh is not performed on the materialized view.
Note:
On the MSS platform, the SamRefreshView function refreshes the summary table or indexed view. On the DB2 platform, the function refreshes the materialized query table (MQT).
Parameters
| Parameter | Description |
|---|---|
|
matview_name |
Specifies the materialized view to be refreshed. |
|
override_complete_refresh |
Default value is true, that is, a complete refresh is performed. Set it to false if you do not want a complete refresh to be performed. |
Example
This example refreshes a materialized view:
/*Refresh a materialized view named MATVIEW1*/
SamRefreshView(“MATVIEW1”);
/*Refresh a materialized view named MATVIEW1 but do not perform complete refresh*/
SamRefreshView(“MATVIEW1”, false);