Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements » Alphabetical list of SQL statements

BEGIN SNAPSHOT statement

Starts a snapshot at a specified period in time for use with snapshot isolation transactions.

Syntax
BEGIN SNAPSHOT
Remarks

By default, when a transaction begins, the database server defers creating the snapshot until the application causes the first row of a table to be fetched. You can use the BEGIN SNAPSHOT statement to start the snapshot earlier within the transaction. The database server creates a snapshot when the BEGIN SNAPSHOT statement is executed by a snapshot transaction.

The statement fails and returns an error when either of the following conditions is met:

  • support for snapshots transactions has not been enabled for the database.

  • a snapshot has already been started for the current transaction.

This statement is also useful for non-snapshot transactions because it allows them to start a snapshot that can be used later in the transaction for a statement-level snapshot operation.

Privileges

None.

Side effects

None.

Standards
  • ANSI/ISO SQL Standard

    Not in the standard.