Home |
Previous Page | Next Page Function Descriptions >
The
mi_collection_delete( ) function
deletes a single element of a collection.
Syntax
mi_integer mi_collection_delete(conn, coll_desc, action, jump)
MI_CONNECTION *conn;
MI_COLL_DESC *coll_desc;
MI_CURSOR_ACTION action;
mi_integer jump;
- conn
- is a pointer to a connection descriptor established by a previous call
to mi_open( ), mi_server_connect( ), or mi_server_reconnect( ).
- coll_desc
- is a pointer to the collection descriptor.
- action
- Determines
the orientation of the deletion. When a collection opens, elements
are available in a cursor. The current cursor position is before
the first element. Possible action values
follow:
- MI_CURSOR_NEXT
- Deletes the next element after the
current cursor position.
- MI_CURSOR_PRIOR
- Deletes the element before the current
cursor position.
- MI_CURSOR_FIRST
- Deletes the first element.
- MI_CURSOR_LAST
- Deletes the last element.
- MI_CURSOR_ABSOLUTE
- Moves jump elements from the beginning
of the cursor and deletes the element at the new cursor position.
- MI_CURSOR_RELATIVE
- Moves jump elements from the current
position and deletes the element at this new cursor position.
- MI_CURSOR_CURRENT
- Deletes the element at the current cursor position.
- jump
- is the absolute or relative offset of the deletion for list collections only.
If action is not MI_CURSOR_ABSOLUTE or MI_CURSOR_RELATIVE when jump is
specified, the function raises an exception and returns MI_NULL_VALUE.
For absolute positioning, a jump value
of 1 is the first element.
Valid in
Client LIBMI Application? |
Valid in User-Defined Routine? |
Yes |
Yes |
Usage
The mi_collection_delete( ) function
deletes the element that the action argument
indicates from the open collection that coll_desc references.
The function deletes the specified element from the collection cursor
that is associated with the coll_desc collection
descriptor. After the deletion of an element, the cursor position
remains on the deleted element.
Return Values
- MI_OK
- indicates that the function was successful.
- MI_NULL_VALUE
- indicates that the function call specifies jump and action is not MI_CURSOR_ABSOLUTE or MI_CURSOR_RELATIVE.
- MI_ERROR
- indicates that the function was not successful, including
an attempt to delete a nonexistent element.
Related Topics
See also the descriptions of mi_collection_close( ), mi_collection_copy( ), mi_collection_create( ), 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 ]