The mi_tab_niorows() accessor function

The mi_tab_niorows() function retrieves the number of rows that the database server expects to process in am_getnext or am_insert.

Syntax

mi_integer
mi_tab_niorows(MI_AM_TABLE_DESC *tableDesc)
tableDesc
Points to the index descriptor.

Usage

Call this function from am_getnext and then loop through the scan as often as necessary to fill the reserved number of rows or until no more rows qualify. See mi_tab_setnextrow() for an example.

Call this function from am_insert and then use the return value to determine how many times to loop through shared memory to get the next row.

Return values

The integer specifies the actual number of rows that the database server has placed in shared memory for am_insert to insert in a new index or the maximum number of rows that am_getnext can place in shared memory.

A return value of 0 indicates that am_open or am_beginscan did not call the mi_tab_setniorows() function or that mi_tab_setniorows() returned an error. Thus, the database server did not reserve memory for multiple rows, and the access method must process only one row.

A negative return value indicates an error.