Default error handling in procedures and triggers

This section describes how SQL Anywhere handles errors that occur during a procedure execution, if you have no error handling built in to the procedure.

For different behavior, you can use exception handlers, described in Using exception handlers in procedures and triggers.

Warnings are handled in a slightly different manner from errors: for a description, see Default handling of warnings in procedures and triggers.

There are two ways of handling errors without using explicit error handling:

  • Default error handling   The procedure or trigger fails and returns an error code to the calling environment.

  • ON EXCEPTION RESUME   If the ON EXCEPTION RESUME clause appears in the CREATE PROCEDURE statement, the procedure carries on executing after an error, resuming at the statement following the one causing the error.

    The precise behavior for procedures that use ON EXCEPTION RESUME is dictated by the on_tsql_error option setting. See on_tsql_error option.

 Default error handling