In a keyset-driven cursor, result set membership is frozen when the
keyset
is fully populated.
当加载所有
键集
时,键集驱动游标会冻结结果集成员资格。
If you have a large result set and need to select just a few rows, use a
keyset
cursor.
当结果集很大并且只需要选择几行时,请使用
键集
游标。
Keyset-driven cursors are controlled by a set of unique identifiers (keys) known as the
keyset
.
键集驱动的游标由一组称为
键集
的唯一标识符(键)控制。
The
keyset
is the set of key values from all the rows returned by the query statement.
键集
是查询语句返回的所有行的一组键值。
Changes to data values (made either by the
keyset
owner or other processes) are visible as the user scrolls through the result set.
当
键集
所有者或其他进程更改数据值时,一旦用户滚动结果集,更改就会反映出来。
The key for the row exists in the
keyset
, but the row no longer exists in the result set.
该行的键存在于
keyset
中,但该行不存在于结果集中。
The
keyset
cursor provides functionality between a static and a dynamic cursor in its ability to detect changes.
键集
游标的更改检测功能介于静态游标和动态游标之间。
When a dynamic cursor is requested, the provider will return a
keyset
cursor and reset the CursorType property to indicate the type of Recordset returned.
The RecordCount property depends on the capabilities of the provider and the type of cursor. The RecordCount property will return -1 for a forward-only cursor, the actual count for a static or
keyset
cursor, and either -1 or the actual count for a dynamic cursor, depending on the data source.
Dynaset-type Recordset- the result of a query that can have updatable records. A dynaset-type Recordset object is a dynamic set of records that you can use to add, change, or delete records from an underlying database table or tables. A dynaset-type Recordset object can contain fields from one or more tables in a type corresponds to an ODBC
keyset
cursor.
The
keyset
cursor provides functionality between a static and a dynamic cursor in its ability to detect changes. Like a static cursor, it does not always detect changes to the membership and order of the result set. Like a dynamic cursor, it does detect changes to the values of rows in the result set.
Changes to data values (made either by the
keyset
owner or other processes) are visible as the user scrolls through the result set. Inserts made outside the cursor (by other processes) are visible only if the cursor is closed and reopened. Inserts made from inside the cursor are visible at the end of the result set.
With keyset-driven cursors, a key is built and saved for each row in the cursor and stored either on the client workstation or on the server. When you access each row, the stored key is used to fetch the current data values from the data source. In a keyset-driven cursor, result set membership is frozen when the
keyset
is fully populated. Thereafter, additions or updates that affect membership are not a part of the result set until it is reopened.