DB-Library supports client-side cursors, while Client-Library supports server-side cursors:
-A client-side cursor does not correspond to an Adaptive Server 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 cursor. Client-Library provides an interface that allows applications to declare, open, and manipulate a server-side cursor, but Adaptive Server actually manages the cursor.
The following table 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). |
Can only fetch forward. |
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. (Client-Library buffers unfetched rows to clear the connection for sending the new command.) |
You cannot access an Open Server application unless the application installs the required DB-Library stored procedures. |
You can access a System 10 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. |