# classname_list_cursor

This function creates a list cursor for (unordered) cursor navigation.

### Prototype

>         MCO_RET	classname_list_cursor(	/*IN*/ mco_trans_h trans,
>                            /*OUT*/ mco_cursor_h cursor );

### Arguments

trans | A `MCO_READ_WRITE` transaction handle established by`mco_trans_start()`
cursor | An instance of a `mco_cursor_h` to be prepared

### Description

This function creates a list cursor for subsequent use by the cursor navigation methods. List cursors iterate over objects of a class in no particular order.

### Return Codes

MCO_S_OK | The cursor was created successfully
MCO_S_CURSOR_EMPTY | There are no objects in class
MCO_ERR_DICT |
MCO_ERR_CURSOR |

### Example

        /* start read-only transaction and initialize cursor in it.	 */
        mco_trans_start( db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &trn );
        /* initialize cursor */
        SimpleClass_list_cursor ( trn, &csr );

        if (rc != MCO_S_OK)
        {
        /* if not found for whatever reason - close the transaction and
        * bail out		 */
        mco_trans_commit(trn);
        return;
        }
        /* commit the transaction. This is only done to illustrate the fact that
        * cursors could be used across the transaction boundaries	 */
        rc = mco_trans_commit(trn);

Related Topics