If you use a statement that begins with the keyword SET in ON EXCEPTION, you must enclose it in a BEGIN ... END statement block. The following list shows some of the SQL statements that begin with the keyword SET:
SET ALL_MUTABLES
|
SET INDEXES
|
The following examples show the incorrect and correct use of a SET LOCK MODE statement inside an ON EXCEPTION statement.
The following ON EXCEPTION statement returns an error because the SET LOCK MODE statement is not enclosed in a BEGIN ... END statement block:
ON EXCEPTION IN (-107) SET LOCK MODE TO WAIT; -- error, value expected, not 'lock' END EXCEPTION;
The following ON EXCEPTION statement executes successfully because the SET LOCK MODE statement is enclosed in a BEGIN ... END statement block:
ON EXCEPTION IN (-107) BEGIN SET LOCK MODE TO WAIT; -- ok END END EXCEPTION;Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]