void mi_errmsg(err_desc, msgbuf, msgbuflen) MI_ERROR_DESC *err_desc; char *msgbuf; mi_integer msgbuflen;
The mi_errmsg( ) function copies the text of an error or warning message from the error descriptor that err_desc references into the user-allocated buffer that msgbuf references. You must ensure that both msgbuflen and msgbuf are large enough to accommodate any error or warning text that the error descriptor might hold. If the buffer is too small, mi_errmsg( ) truncates the message. System-generated messages, especially those that contain pathnames, can be quite long. A good starting value for buflen is usually 256.
The mi_errmsg( ) function always terminates the message with a null terminator, provided msgbuflen is greater than 0. Message text that mi_errmsg( ) retrieves for database server exceptions is the most specific text, that is, the text associated with the Informix SQLCODE value. The mi_errmsg( ) function does not retrieve any ANSI or X/Open message text.
A separate, additional callback follows the callback for the SQLCODE value when an exception has an access-method error code (Informix RSAM status). This error code and message text are available through the mi_errmsg( ) and mi_error_sqlcode( ) functions.
For a C UDR, mi_errmsg( ) does not prefix the message text with the error number.
For a client LIBMI application, mi_errmsg( ) adds error codes to the start of the message.
The mi_errmsg( ) function is useful in an exception callback for getting the error or warning message associated with an exception.
None.
See also the descriptions of mi_error_desc_copy( ), mi_error_desc_destroy( ), mi_error_desc_is_copy( ), mi_error_level( ), mi_error_sql_state( ), and mi_error_sqlcode( ).
For general information about how to obtain information from an error descriptor, see the IBM Informix: DataBlade API Programmer's Guide.