The mi_collection_create() function

The mi_collection_create() function creates a collection.

Syntax

MI_COLLECTION *mi_collection_create(conn, typeid_ptr)
   MI_CONNECTION *conn;
   MI_TYPEID *typeid_ptr;
conn
A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().
typeid_ptr
A pointer to the type identifier for the new collection.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_collection_create() function creates a new collection structure of the collection type that typeid_ptr references. This function is a constructor function for the collection structure. To access items of the collection, you must first open the collection with the mi_collection_open() function.

Server only: The mi_collection_create() function allocates a new collection structure in the current memory duration.

For a description of collections, see the Informix® DataBlade® API Programmer's Guide.

Return values

An MI_COLLECTION pointer
A pointer to the newly created collection.
NULL
The function was not successful.