If the database option wait_for_commit is On, or if a foreign key is defined using CHECK ON COMMIT in the CREATE TABLE statement,
you can update the database and cause a referential integrity violation if the violations are resolved before the changes
You can use the sa_check_commit system procedure to check whether there are any outstanding referential integrity violations
before attempting to commit your changes.
The returned parameters indicate the name of a table containing a row that is currently violating referential integrity, and
the name of the corresponding foreign key index.
The following set of statements can be executed from Interactive SQL. Rows are deleted from the Departments table in the sample
database and a referential integrity violation occurs. The call to the sa_check_commit system procedure checks which tables
and keys have outstanding violations, and the rollback cancels the change.
SET TEMPORARY OPTION wait_for_commit='On';
DELETE FROM Departments;
CREATE OR REPLACE VARIABLE tname VARCHAR( 128 );
CREATE OR REPLACE VARIABLE keyname VARCHAR( 128 );
CALL sa_check_commit( tname, keyname );
SELECT tname, keyname;
SET TEMPORARY OPTION wait_for_commit='Off';