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

mi_tab_mode()

The mi_tab_mode() function retrieves the I/O mode of the table from the table descriptor.

Syntax

mi_unsigned_integer 
mi_tab_tab_mode(MI_AM_TABLE_DESC *tableDesc)
tableDesc
points to the table descriptor.

Usage

The I/O mode refers to the operations expected subsequent to the opening of a table.

To determine the input and output requirements of the current statement
  1. Call mi_tab_mode() to obtain an input/output indicator.
  2. Pass the value that mi_tab_mode() returns to the macros in Table 10 for interpretation.

    Each macro returns either MI_TRUE or MI_FALSE.

    Table 10. Macro Modes
    Macro Mode Verified
    MI_INPUT() Open for input only, usually in the case of a SELECT statement
    MI_OUTPUT() Open for output only, usually in the case of an INSERT statement
    MI_INOUT() Open for input and output, usually in the case of an UPDATE statement
    MI_NOLOG() No logging required

In the following example, the access method calls mi_tab_mode() to verify that a query is read-only. If MI_INOUT() returns MI_FALSE, the access method requests a multiple-row buffer because the access method can return several rows without interruption by an update:

if (MI_INOUT(tableDesc) == MI_FALSE)
   mi_tab_setniorows(tableDesc, 10);

If MI_inOUT() returns MI_TRUE, the access method can process only one row identifier with each call to am_getnext.

Return Values

The integer indicates whether an input or output request is active.

To interpret the returned integer, use the macros that Table 10 describes.

Related Topics

See the descriptions of

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