The mi_tab_mode() accessor function
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:
- Call mi_tab_mode() to obtain an input/output indicator.
- Pass the value that mi_tab_mode() returns to
the macros in the following table for interpretation.
Each macro returns either MI_TRUE or MI_FALSE.
Table 1. 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 1 describes.