mi_integer am_getnext(MI_AM_SCAN_DESC *scanDesc, MI_ROW **row, mi_integer *rowid);
Every access method must provide an am_getnext purpose function. This required function typically reads source data and returns query results.
If a statement includes a WHERE clause, either am_beginscan or am_getnext can parse the qualification descriptor. For each row, an am_getnext purpose function might:
To find out how to create a row, refer to Converting to and from Row Format.
The am_getnext purpose function can loop to fill a shared-memory buffer with multiple rows. For more information about buffering, see Buffering Multiple Results.
The database server calls the am_getnext purpose function until that function returns MI_NO_MORE_RESULTS. Then the database server calls the am_endscan purpose function, if any, that the access method supplies.
If the access method does not provide an am_rescan purpose function, am_getnext stores interim data for subsequent scans in memory that persists between executions of the access method. For more information on memory duration, refer to Storing Data in Shared Memory.
MI_ROWS indicates the return of a qualified row.
MI_NO_MORE_RESULTS indicates the end of the scan.
MI_ERROR indicates failure.
See the descriptions of: