1. Introduction : OpenAPI Concepts and Processes : How Cursors Work : Order of Function Calls Used to Manipulate Data with a Cursor
 
Share this page                  
Order of Function Calls Used to Manipulate Data with a Cursor
To use a cursor, the application:
1. Opens the cursor with IIapi_query().
2. Provides cursor name and parameter descriptions and values with IIapi_setDescriptor() and IIapi_putParms().
3. Requests a description of the data being returned from the server with IIapi_getDescriptor().
The application may call IIapi_getQueryInfo() to obtain the status of the open cursor request.
4. Optionally positions the cursor with IIapi_scroll() and IIapi_position().
5. Requests the data with calls to IIapi_getColumns() until the function returns with a status of “no more data.”
The application may call IIapi_getQueryInfo() after each call to IIapi_getColumns() to obtain the status of the fetch request.
If the application is deleting or updating information with a cursor, it specifies the cursor delete or update statement for the row where the cursor is positioned. The statement handle returned from the open statement should be used as a cursor ID value for the delete or update statement.
6. Closes the SQL statement and releases the statement handle with IIapi_close(). This automatically closes the cursor.