INFORMIX
DataBlade API Programmer's Manual
Chapter 12: DataBlade API Function Descriptions
Home Contents Index Master Index New Book

mi_error_sqlcode()

The mi_error_sqlcode() function retrieves the value of the Informix SQLCODE status variable (server only).

Syntax

Usage

This function is intended for use with the MI_ERROR_DESC structure passed to a callback routine when the callback exception is of type MI_Exception.

To indicate the success or failure of SQL statements, the database server sets the following status variables:

The mi_error_sqlcode() function retrieves the SQLCODE value to provide more information about IX000 cases.

Important: The mi_error_sqlcode() function is different from the Illustra mi_error_sql_code() function, which returns the SQLSTATE value rather than the SQLCODE value.

If no SQLCODE value is defined, as for mi_db_error_raise() exceptions, mi_error_sqlcode() sets sqlcodep to 0.

Tip: In cases where the SQLSTATE value is sufficient for your application, use SQLSTATE rather than SQLCODE.

Return Values

MI_OK

The function retrieved the SQLCODE value.

MI_ERROR

The function was not successful.

Related Topics

For additional information, see the descriptions of the following functions: mi_errmsg(), mi_error_desc_copy(), mi_error_desc_is_copy(), mi_error_desc_destroy(), mi_error_level(), and mi_error_sql_state().




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.