SAND CDBMS SQL Reference Guide
REFRESH SNAPSHOT TABLE

 

The REFRESH SNAPSHOT TABLE command updates an existing snapshot table so that its data corresponds with that of the source tables.


Required Privileges

In order to refresh a snapshot table, the user authorization must own the table, own or possess OWNER privileges on the schema to which the snapshot table belongs, or possess DBA privileges.


Syntax


snapshot table name

This is the name of an existing snapshot table in the current schema. The snapshot table name may be qualified by a schema name (that is, <schema name>.<snapshot table name>) to update a snapshot table that is not in the current schema.


Description

The REFRESH SNAPSHOT TABLE statement updates the specified snapshot table if the data in the underlying source tables has changed, either since the snapshot table was created or since the last time this command was executed against the snapshot table. If snapshot table data was manually changed through direct INSERTs, UPDATEs, and DELETEs, the REFRESH SNAPSHOT TABLE command will erase all of those changes when the snapshot table is synchronized with the source tables.

Note that the REFRESH SNAPSHOT TABLE command performs a full update, which is equivalent to re-executing the snapshot's defining query.


Example

REFRESH SNAPSHOT TABLE st1;

The above example updates an existing snapshot table named st1.