Define a cursor life span
You can define the life span of the cursor with the control-flag bit mask. By default, the database server closes all cursors at the end of a transaction. If your module requires uninterrupted access to a set of rows across transaction boundaries, you can define a hold cursor. A hold cursor can be either a sequential or a scroll cursor.
To define a hold cursor, you specify the MI_SEND_HOLD
constant in the control-flag bit mask of the mi_open_prepared_statement() function,
as the following table shows.
| Cursor | Control-flag value |
|---|---|
| Update sequential cursor with hold | MI_SEND_HOLD |
| Read-only sequential cursor with hold | MI_SEND_READ + MI_SEND_HOLD |
| Update scroll cursor with hold | MI_SEND_SCROLL + MI_SEND_HOLD |
| Read-only scroll cursor with hold | MI_SEND_READ + MI_SEND_SCROLL + MI_SEND_HOLD |