Prepare To Commit Statement - Sybase Adaptive Server Anywhere Reference

Table of Contents

Advertisement

PREPARE TO COMMIT statement

PREPARE TO COMMIT statement
Function
Syntax
Permissions
Side effects
See also
Description
Standards and
compatibility
Examples
580
Use this statement to check whether a COMMIT can be performed
successfully.
PREPARE TO COMMIT
None.
None.
"COMMIT statement" on page 420
"ROLLBACK statement" on page 597
The PREPARE TO COMMIT statement tests whether a COMMIT can be
performed successfully. The statement will cause an error if a COMMIT is
impossible without violating the integrity of the database.
SQL/92
Vendor extension.
Not supported in Adaptive Server Enterprise.
Sybase
The following sequence of statements leads to an error because of
foreign key checking on the employee table.
EXECUTE IMMEDIATE
"SET OPTION wait_for_commit = 'on'";
EXECUTE IMMEDIATE "DELETE FROM employee
WHERE emp_id = 160";
EXECUTE IMMEDIATE "PREPARE TO COMMIT";
The following sequence of statements does not cause an error when the
delete statement is executed, even though it causes integrity violations.
The PREPARE TO COMMIT statement returns an error.
SET OPTION wait_for_commit= 'ON';
DELETE
FROM department
WHERE dept_id = 100;
PREPARE TO COMMIT;

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents