1. Introduction : OpenAPI Concepts and Processes : How Cursors Work
 
Share this page                  
How Cursors Work
Cursors enable an application to process, one at a time, the result rows returned by a select statement. The following SQL statements are used in processing data with a cursor:
update (cursor)
Updates the current row.
delete (cursor)
Deletes the current row.
If a cursor is opened as updatable (the default), the application can update or delete the row referenced by the cursor. If the cursor is opened as read-only, the application can read the data but cannot update or delete it.
When an application calls IIapi_query() to open a cursor, it provides the name of the cursor as a parameter in subsequent calls to IIapi_setDescriptor() and IIapi_putParms(). Cursor name is the character string, unique within the application, that represents the cursor.
When the application calls IIapi_query() to update or delete data with a cursor, it provides the cursor ID as a parameter in subsequent calls to IIapi_setDescriptor() and IIapi_putParms(). Cursor ID is the statement handle returned by IIapi_query() when the cursor is opened.