The mi_tab_nextrow() accessor function
The mi_tab_nextrow() function fetches the next index entry from several that the database server stores in shared memory.
Syntax
mi_integer
mi_tab_nextrow(MI_AM_TABLE_DESC *tableDesc,
MI_ROW **row,
mi_integer *rowid,
mi_integer *fragid)
- tableDesc
- Points to the index descriptor.
- row
- Points to the address of a row structure. The row structure contains the index entry that the access method reformats, if necessary, and inserts into the virtual index.
- rowid
- Points to the row identifier of the associated table row.
- fragid
- Points to the fragment identifier of the associated table row.
Usage
Use this function from the am_insert purpose function if am_insert can insert more than one new index entry. The values in row, rowid, and fragid replace the new row and row-ID descriptor that the database server passes to am_insert if shared memory holds only one new index entry.
The mi_tab_nextrow() function
works together with the following related accessor functions:
- The mi_tab_setniorows() function sets a number of rows to pass to am_insert.
- The mi_tab_niorows() function gets the number of rows to expect.
For an example of how these three functions work together, see Figure 1.
Return values
The return value increments for each call to am_insert. The first call to mi_tab_nextrow() returns 0, the second returns 1, and so forth. A negative return value indicates an error.