INFORMIX
DataBlade API Programmer's Manual
Chapter 12: DataBlade API Function Descriptions
Home Contents Index Master Index New Book

mi_next_row()

The mi_next_row() function fetches the next row from the database server.

Syntax

Usage

Use the mi_next_row() function when mi_get_result() indicates that rows are waiting to be fetched by returning MI_ROWS.

The mi_next_row() function returns a handle to the row just fetched, termed the current row, which can subsequently be used in any routine that passes a row (MI_ROW) as an argument. Only one row per connection is current. The row handle is valid until the query finishes, mi_next_row() is called again, or mi_close() is called on the connection.

The mi_next_row() function is typically executed in a loop that terminates when the function returns NULL, indicating that no more rows remain to be fetched. If no more rows remain to be fetched, the function sets *error to zero.

After a row is successfully fetched with mi_next_row(), its values can be extracted with mi_value().

Upon successful completion, the mi_next_row() function advances the database server to the next row waiting to be fetched on the connection.

Upon failure, mi_next_row() returns NULL and sets *error to MI_ERROR.

Return Values

On success, returns a pointer to the current row.

If no more rows remain to be fetched or on failure, returns NULL.

Related Topics

For additional information, see "Fetching Data" and the descriptions of the following functions: mi_get_result() and mi_value().




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.