DB-Library supports client-side cursors, while Client-Library supports server-side cursors:
A client-side cursor does not correspond to an Adaptive Server Enterprise cursor. Instead, DB-Library buffers rows internally and performs all necessary keyset management, row positioning, and concurrency control to manage the cursor.
A server-side cursor, sometimes called a “native” cursor, is an actual Adaptive Server Enterprise cursor. Client-Library provides an interface that allows applications to declare, open, and manipulate a server-side cursor, but Adaptive Server Enterprise actually manages the cursor.
Table 6-1 outlines some key differences between DB-Library and Client-Library cursors:
DB-Library cursors |
Client-Library cursors |
---|---|
Cursor row position is defined by the client. |
Cursor row position is defined by the server. |
Can define optimistic concurrency control. |
Cannot define optimistic concurrency control. |
Can fetch backwards (if scrollopt is CUR_KEYSET or CUR_DYNAMIC in the call to dbcursoropen). |
With scrollable cursors, it is possible to fetch data in any of these fetch orientations:
|
Memory requirements depend on the size of the fetch buffer specified during dbcursoropen. |
Memory requirements depend on the cursor-rows setting and whether the application sends new commands on the connection while the cursor is open. |
You cannot access an Open Server application unless the application installs the required DB-Library stored procedures. |
You can access an Open Server application that is coded to support cursors. |
Slower performance. |
Faster performance. |
Multiple cursors per DBPROCESS possible. |
Multiple cursors per CS_CONNECTION possible. Only one cursor per CS_COMMAND structure. |