Warnings and errors

The MI_Exception event indicates which of the following status conditions has caused the database server exception:
  • A warning is a condition that does not prevent successful execution of an SQL statement; however, the effect of the statement is limited and the statement might not produce the expected results.
  • A runtime error (or failure) indicates that the SQL statement or DataBlade® API function did not execute successfully and it made no change to the database.
    Runtime errors can occur at the following levels:
    • Hardware errors include controller failure, bad sector on disk, and other hardware errors.
    • Kernel errors include file-table overflow, insufficient semaphores, and other kernel errors.
    • Access-method errors include duplicated index keys, SQL null inserted into non-null columns, and other access-method errors.
    • Parser errors include invalid syntax, unknown objects, invalid statements, and parser errors.
    • DataBlade API library errors are usually caused by invalid arguments.
The following list describes the most common DataBlade API library errors:
  • The DataBlade API might not have been initialized.
  • One of the DataBlade API initialization functions must be the first DataBlade API call in the module.
  • A function that passes a connection descriptor (MI_CONNECTION) passes an invalid connection, one that was closed or dropped.
  • A function that passes a row descriptor (MI_ROW_DESC) can pass an invalid row descriptor.
  • A function that passes a row structure (MI_ROW) passes an invalid row.
  • A function that passes a column name passes a column name that does not exist in the object or objects being accessed.
  • A function that passes a column number passes a column number that is out of range (greater or less than the number of columns in the object).
  • A function that passes an event type (MI_EVENT_TYPE) passes a nonexistent event type.
  • A function that passes a save set (MI_SAVE_SET) passes an invalid save set.
  • A function that passes a buffer passes a null buffer or a buffer that is too small.
  • A function that passes a pointer passes an invalid pointer.
  • If the pointer_checks_enabled field of the parameter information structure is set, a pointer might not be within the process heap space.

Potential exceptions other than these types of common invalid arguments are mentioned in the Return Values section of the individual function descriptions in the Informix® DataBlade API Function Reference.

An error descriptor for an MI_Exception event indicates the status condition of the event with one of the following exception levels.
Status condition Exception level Description
Warning MI_MESSAGE Raised when the database server generates a warning or an informational message. The database server passes a warning back to the client application; it is up to the client to display the warning message.
Runtime error (failure) MI_EXCEPTION Raised when the database server generates a runtime error.

The mi_error_level() function returns the exception level from an error descriptor for the MI_Exception event.