ASA Programming Guide
Using SQL in Applications
Choosing cursor types
You request a cursor type, either explicitly or implicitly, from the programming interface. Different interface libraries offer different choices of cursor types. For example, JDBC and ODBC specify different cursor types.
Each cursor type is defined by a number of characteristics:
Uniqueness Declaring a cursor to be unique forces the query to return all the columns required to uniquely identify each row. Often this means returning all the columns in the primary key. Any columns required but not specified are added to the result set. The default cursor type is non-unique.
Updatability A cursor declared as read only may not be used in a positioned update or delete operation. The default cursor type us updatable.
Scrollability You can declare cursors to behave different ways as you move through the result set. Some cursors can fetch only the current row or the following row. Others can move backwards and forwards through the result set.
Sensitivity Changes to the database may or may not be visible through a cursor.
These characteristics may have significant side effects on performance and on database server memory usage.
Adaptive Server Anywhere makes available cursors with a variety of mixes of these characteristics. When you request a cursor of a given type, Adaptive Server Anywhere matches those characteristics as well as it can. The details of how Adaptive Server Anywhere cursors match the cursor types specified in the programming interfaces are the subject of the following sections.
There are some occasions when not all characteristics can be supplied. For example, insensitive cursors in Adaptive Server Anywhere must be read-only, for reasons described below. If your application requests an updatable insensitive cursor, a different cursor type (value-sensitive) is supplied instead.