DatabaseLink`
DatabaseLink`

SQLSavepoint

SQLSavepoint[]

is an object that represents a savepoint in an SQL transaction.

更多信息和选项

  • To use SQLSavepoint, you first need to load DatabaseLink using Needs["DatabaseLink`"].
  • SQLSetSavepoint returns an SQLSavepoint object.
  • A group of SQL commands grouped into a transaction will only take effect permanently when the transaction is committed. The transaction can be canceled or returned to a savepoint.
  • The following option can be given:
  • "Name"""the name of the savepoint

范例

基本范例  (1)

If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the "DatabaseLink`DatabaseExamples`" package, as described in Using the Example Databases.

Open a connection:

Begin a transaction:

Insert data:

Create a savepoint:

Insert more data:

Roll back to the savepoint:

Commit the transaction:

The table only contains data inserted up to the savepoint: