ON ERROR
In a Script, stops at the first failed statement (STOP) or continues (CONTINUE, the default)
Arguments
STOP | CONTINUE (mandatory)
Examples
ON ERROR STOP;
ON ERROR CONTINUE;
Notes
Chooses what a Script does after a failed statement: ON ERROR STOP or ON ERROR CONTINUE.
Allowed in Scripts only. Every Script run starts with CONTINUE: a failed statement is reported and counted, and the next statement runs. After ON ERROR STOP, the first failed statement ends the Script: nothing after it runs, a message names the statement and its line, and the Script's status is FAILED. A Script called by this Script starts with the same setting; a change made inside it ends when it returns.
A failed SQL statement rolls back the pending transaction, as it always did: with autocommit OFF, earlier uncommitted changes are lost too, and a warning says so. ON ERROR STOP itself never commits or rolls back. At the prompt, a line of several statements already stops at its first failure.
See Error handling in the SQL scripting guide, including what ON ERROR CONTINUE means for the transaction.
Last modified in release 5.3.3.
BroadSQL