RELEASE,
ROLLBACK, and
SAVEPOINT and are supported at the session level (outside of stored procedures) only if AUTOCOMMIT is off. Otherwise,
RELEASE,
ROLLBACK, and
SAVEPOINT must be used within a stored procedure.
The following example sets a SAVEPOINT then checks a condition to determine whether to
ROLLBACK or to
RELEASE the
SAVEPOINT.