Open a collection

After you have a collection structure for a collection, you can open the collection with one of the following functions:
Table 1. DataBlade® API functions to open a collection
DataBlade API Function Use
mi_collection_open() Opens a collection in a read/write scroll cursor
mi_collection_open_with_options() Opens a collection in either of the following open modes:
  • Read only
  • Nonscrolling

Both of the functions in the preceding table are constructor functions for a collection descriptor. Use this collection descriptor in calls to DataBlade API functions that access the collection.

When one of the functions in the preceding table opens a collection, it creates a collection cursor, which is an area of memory that serves as a holding place for collection elements. This cursor has an associated cursor position, which points to one element of the collection cursor. When these functions complete, the cursor position points to the first element of the collection.

The difference between the mi_collection_open() and mi_collection_open_with_options() functions is the open mode that they create for the collection cursor.