


A view table, as described in Section Creating Views, provides a logical view to data that is physically stored in a base table. A snapshot table is described like a view, but it allows copies of partial data to be created from a base table.
A so-called snapshot is created from a described section of a table. This snapshot is physically stored in the database.
Modifications to the table on which the snapshot is based are not automatically done to the snapshot. The modifications can be done asynchronously either by copying the whole data or by using the modification log, the so-called snapshot log. The execution of the modifications is initiated by the REFRESH statement.
In snapshot tables, only SELECTS are possible. INSERT, UPDATE or DELETE statements are not allowed.
A section from the table 'customer' is to be recorded in a snapshot table. A snapshot log is generated for the table:
CREATE SNAPSHOT snap1 AS
SELECT cno,name,firstname,city
FROM customer
CREATE SNAPSHOT LOG ON customer
The table 'customer' on which the snapshot is based is then modified by removing all customers living in Los Angeles from the table.
DELETE FROM customer
WHERE city = 'Los Angeles'
A SELECT issued on the snapshot table then produces the following result:

The command
REFRESH SNAPSHOT snap1
has the effect that the modifications on the table 'customer' are also executed on the table 'snap1'.
SELECT * from snap1



