Position the cursor to the next object in the index.
MCO_RET mco_cursor_next( /*IN*/ mco_trans_h t, /*INOUT*/ mco_cursor_h c);
|
t |
The |
|
c |
A cursor handle returned from a cursor or index search function |
This function positions the cursor to the next object in the index. A list cursor will be positioned to the next object in an arbitrarily ordered list of objects. A tree index cursor will be positioned to the next object in the list ordered by the index.
| MCO_S_OK | The cursor was positioned successfully |
| MCO_S_CURSOR_END | The cursor reached the end of the list |
| MCO_E_CURSOR_INVALID | Invalid cursor handle |
| MCO_ERR_CURSOR | Fatal cursor error |
Application snippet:
const char * dbname = "SimpleDb";
int main(int argc, char* argv[])
{
mco_db_h db;
MCO_RET rc;
mco_device_t dev;
mco_db_params_t db_params;
mco_trans_h t;
mco_cursor_t c;
MCO_CURSOR_TYPE ctype;
...
rc = mco_db_open_dev( dbname, simple_get_dictionary(), &dev, 1, &db_params );
if ( MCO_S_OK != rc )
{
rc = mco_db_connect( dbname, &db );
...
rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);
if ( MCO_S_OK == rc )
{
...
A_list_cursor( t, &c);
for ( rc = mco_cursor_first( t, &c ); MCO_S_OK == rc; rc = mco_cursor_next( t, &c ) )
{
// Do something with the object at this cursor position
...
}
...
}
}
...
}