> # Using Scrollable Cursors

> Scrollable cursors can move backward and forward in a result set, allowing the application user to scroll back and forth through requested data. SequeLink supports two types of scrollable cursors-static and keyset-driven.

> ### Static and Keyset-Driven Cursors

> A static cursor is one that does not detect any changes made to the record after the cursor is opened. For example, if a static cursor fetches a row and another application then updates that row, the values would be unchanged when that row is fetched again. A keyset-driven cursor detects value changes to the record using keys that are saved when the cursor is opened to retrieve the current data values for each row.

> Support for the keyset-driven cursors depends on the data store to which you are connecting, as described in Table 2-8.

> Table 2-8. Support for Keyset-Driven Cursors (ODBC)
> Database | Conditions for Support
> --- | ---
> DB2 UDB | The DB2 tables must contain an auto-unique column. The name and other properties of the auto-unique column must be configured in the data source of the SequeLink Server.
> Informix | None (inherently supported).
> Microsoft SQL Server | The table must contain an identity column.
> JDBC Socket | The backend database must support an auto-unique column. The name and other properties of the auto-unique column must be configured in the data source of the SequeLink Server.
> ODBC Socket | The backend database must support an auto-unique column. The name and other properties of the auto-unique column must be configured in the data source of the SequeLink Server.
> Oracle | None (inherently supported).
> Sybase | The table must contain an identity column.

> ### Using Static Scrollable Cursors

> - The ODBC driver supports static cursors for all types of result set generating statements, including result sets generated by stored procedures.
> - The ODBC driver supports LOB data for static cursors; however, by default, only the first 4096 bytes of the LOB column is buffered. See the SLKStaticCursorLongColBuffLen connection attribute in Table 1-1 "ODBC Connection Attributes" for more information about specifying the amount of data that is buffered.
> - To persist a result set as an XML data file with embedded schema, you must use static cursors. See "Persisting a Result Set as an XML Data File" for more information about persisting XML data files.

> ### Using Keyset-Driven Scrollable Cursors

> - The ODBC driver does not support using keyset-driven cursors on stored procedures or explicit batches.
> - The ODBC driver cannot use keyset-driven cursors, when the Select statement contains any of the following SQL language constructions:
> - JOIN
> - Aggregate functions
> - GROUP BY
> - (Informix only). When a fragmented table is not explicitly created with the WITH ROWIDS clause, the ODBC driver returns SQL_SUCCESS_WITH_INFO, with the message that a static cursor was substituted.