H2 Database 简明教程

H2 Database - Savepoint

SAVEPOINT 是一个用于临时保存事务的命令。最好在您的事务中保留保存点,因为它有助于在必要时将事务回滚到各自的保存点。

SAVEPOINT is a command used to temporarily save the transaction. It is better to maintain savepoints in your transaction as it is helpful to roll back the transaction to the respective Savepoint whenever necessary.

Syntax

以下是 Savepoint 命令的一般语法。

Following is the generic syntax of the Savepoint command.

SAVEPOINT savepointName

Example

在这个例子中,我们将使用以下命令创建一个名为 Half_Done 的保存点。

In this example, we will create a Savepoint named Half_Done using the following command.

SAVEPOINT Half_Done;

以上命令会产生以下输出。

The above command produces the following output.

Savepoint created