Home | Previous Page | Next Page   Function Descriptions >

mi_collection_open_with_options( )

The mi_collection_open_with_options( ) function opens a collection in a specified open mode.

Syntax

MI_COLL_DESC *mi_collection_open(conn, coll_ptr, control)
   MI_CONNECTION *conn;
   MI_COLLECTION *coll_ptr;
   mi_integer control;
conn
is a pointer to a connection descriptor established by a previous call to mi_open( ), mi_server_connect( ), or mi_server_reconnect( ).
coll_ptr
is a pointer to the collection structure to open.
control
is a bit-mask integer value that specifies the type of collection cursor to create and open. The following bit-mask flags are valid:
MI_COLL_READONLY
Cursor is read-only.
MI_COLL_NOSCROLL
Cursor is a sequential cursor (not a scroll cursor).
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

The mi_collection_open_with_options( ) function is a constructor function for the collection descriptor. The function opens the collection that coll_ptr references and returns a collection descriptor for the open collection. Other DataBlade API collection functions use this collection descriptor to access the elements of a collection.

Server Only

The mi_collection_open_with_options( ) function allocates a new collection descriptor in the current memory duration.

End of Server Only

This function creates a collection cursor to hold the collection elements. By default, this cursor is an update scroll cursor. If this type of cursor is not adequate for your DataBlade API module, you can create a collection cursor with characteristics specified by a bit mask in the control argument.

Collection Cursor Type
Control-Flag Value
Update scroll cursor
None (default)
Read-only scroll cursor
MI_COLL_READONLY
Update sequential cursor
MI_COLL_NOSCROLL
Read-only sequential cursor
MI_COLL_READONLY + MI_COLL_NOSCROLL

This function is useful for accessing collection subqueries.

Return Values

An MI_COLL_DESC pointer
is the address of the collection descriptor for the opened collection.
NULL
indicates that the function was not successful.

Related Topics

See also the descriptions of mi_collection_close( ), mi_collection_copy( ), mi_collection_create( ), mi_collection_delete( ), mi_collection_fetch( ), mi_collection_free( ), mi_collection_insert( ), mi_collection_open( ), mi_collection_update( ), mi_open( ), mi_server_connect( ), and mi_server_reconnect( ).

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

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]