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 table descriptor.
row
Points to the address of a row structure that contains fetched data.
rowid
Points to the row identifier of the fetched values.
fragid
Is the ID associated with a fragment represented in the table descriptor.

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 row.

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.