Set savepoint for transaction
transactionSetSavepoint(savepoint)
returns void
Name | Type | Required | Default | Description |
---|---|---|---|---|
savepoint | string | Yes | Savepoint name to which can be rolled back |
This example runs multiple queries with a savepoint for each, and rolls back to the ‘useradded’ savepoint if the last query fails.
transaction {
// insert user
transactionSetSavepoint('useradded');
try {
// another query
}
catch(any e) {
transactionRollback();
}
}