Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » SQL Anywhere Server - SQL Usage » Stored procedures, triggers, batches, and user defined functions » Error and warning handling


Default handling of errors

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.

Warnings are handled in a slightly different manner from errors.

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.

 Default error handling
 See also