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

SQL Anywhere 11.0.1 » UltraLite - C and C++ Programming » API Reference » UltraLite C/C++ common API reference

 

Callback function for ULRegisterErrorCallback

Handles errors that the UltraLite runtime signals to your application.

For a description of error handling using this technique, see ULRegisterErrorCallback function.

Syntax
ul_error_action UL_GENNED_FN_MOD error-callback-function (
SQLCA * sqlca,
ul_void * user_data,
ul_char * buffer
);
Parameters
  • error-callback-function   The name of your function. You must supply the name to ULRegisterErrorCallback.

  • sqlca   A pointer to the SQL communications area (SQLCA).

    The SQLCA contains the SQL code in sqlca->sqlcode. Any error parameters have already been retrieved from the SQLCA and stored in buffer.

    This sqlca pointer does not necessarily point to the SQLCA in your application, and cannot be used to call back to UltraLite. It is used only to communicate the SQL code to the callback.

    In the C++ component, use the Sqlca.GetCA method.

  • user_data   The user data supplied to ULRegisterErrorCallback. UltraLite does not change this data in any way. Because the callback function may be signaled anywhere in your application, the user_data argument is an alternative to creating a global variable.

  • buffer   The buffer supplied when the callback function was registered. UltraLite fills the buffer with a string, which holds any substitution parameters for the error message. To keep UltraLite as small as possible, UltraLite does not supply error messages themselves. The substitution parameters depend on the specific error. For more information about error parameters for SQL errors, see SQL Anywhere error messages.

Return value

Returns one of the following actions:

  • UL_ERROR_ACTION_CANCEL   Cancel the operation that raised the error.

  • UL_ERROR_ACTION_CONTINUE   Continue execution, ignoring the operation that raised the error.

  • UL_ERROR_ACTION_DEFAULT   Behave as if there is no error callback.

  • UL_ERROR_ACTION_TRY_AGAIN   Retry the operation that raised the error.

See also