The mi_tab_setnextrow() accessor function

The am_getnext purpose function calls mi_tab_setnextrow() to store the next entry that qualifies for selection.

Syntax

mi_integer
mi_tab_setnextrow(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 that contains fetched data under the following conditions:
  • The query projects only index-key columns.
  • The am_keyscan purpose flag is set.
Otherwise, row might not exist.
rowid
Points to the row identifier of the table row that contains the key values.
fragid
Points to the fragment identifier of the associated table row.

Usage

Use this function in the am_getnext purpose function if the access method can fetch multiple rows into shared memory. The values in row and rowid replace arguments that the database server passes to am_getnext if shared memory accommodates only one fetched index entry.

The mi_tab_setnextrow() function works together with the following other accessor functions:
  • The mi_tab_setniorows() function sets a number of rows to pass to am_getnext.
  • The mi_tab_niorows() function sets the number of rows to expect.

Return values

The integer indicates which row in shared memory to fill. The first call to mi_tab_setnextrow() returns 0. Each subsequent call adds 1 to the previous return value. The maximum rows available depends on the value that mi_tab_niorows() returns.

A negative return value indicates an error.