Home | Previous Page | Next Page   Descriptor Function Reference > Accessor Functions >

mi_tab_check_msg()

The mi_tab_check_msg() function sends messages to the oncheck utility.

Syntax

mi_integer mi_tab_check_msg(MI_AM_TABLE_DESC *tableDesc,
   mi_integer msg_type, 
   char *msg[, marker_1, ..., marker_n]) 
tableDesc
points to the descriptor for the index that the oncheck command line specifies.
msg_type
indicates where oncheck should look for the message.

If msg_type is MI_SQL, an error occurred. The syserrors system catalog table contains the message.

If msg_type is MI_MESSAGE, the pointer in the msg argument contains the address of an information-only message string.

msg
points to a message string of up to 400 bytes if msg_type is MI_MESSAGE.

If msg_type is MI_SQL, msg points to a 5-character SQLSTATE value. The value identifies an error or warning in the syserrors system catalog table.

marker_n
specifies a marker name in the syserrors system catalog table and a value to substitute for that marker.

When a user initiates the oncheck utility, the database server invokes the am_check purpose function, which checks the structure and integrity of virtual indexes. To report state information to the oncheck utility, am_check can call the mi_tab_check_msg() function.

The syserrors system catalog table can contain user-defined error and warning messages. A five-character SQLSTATE value identifies each message.

The text of an error or warning message can include markers that the access method replaces with state-specific information. To insert state-specific information in the message, the access method passes values for each marker to mi_tab_check_msg().

To raise an exception whose message text is stored in syserrors, provide the following information to the mi_tab_check_msg() function:

The access method can allocate memory for messages or create automatic variables that keep their values for the duration of the mi_tab_check_msg() function.

The DataBlade API mi_db_error_raise() function works similarly to mi_tab_check_msg(). For examples that show how to create messages, refer to the description of mi_db_error_raise() in the IBM Informix: DataBlade API Programmer's Guide.

Important:
Do not use msg_type values MI_FATAL or MI_EXCEPTION with mi_tab_check_msg(). These message types are reserved for the DataBlade API function mi_db_error_raise().

Return Values

None

Related Topics

See the descriptions of:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]