FireDAC.Stan.Option.TFDFetchOptions.CursorKind
Delphi
property CursorKind: TFDCursorKind read GetCursor write SetCursor
C++
__property TFDCursorKind CursorKind = {read=GetCursor, write=SetCursor, stored=IsCKS, default=0};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | FireDAC.Stan.Option.pas FireDAC.Stan.Option.hpp |
FireDAC.Stan.Option | TFDFetchOptions |
Description
Specifies the type of cursor a FireDAC command or dataset uses.
Set the CursorKind to indicate the type of cursor the FireDAC command or dataset uses for the result set when it is opening. CursorKind must be set prior to preparing the command or dataset.
To change the CursorKind for an already used dataset, the application can call the Disconnect method first.
CursorKind affects the:
- Time to return the first record or open the result set.
- Time to return all result set records.
- Ability to use multiple open cursors.
- Cursor stability.
- Used DBMS resources.
- TFDTable mode.
Option |
Description |
---|---|
|
A driver automatically chooses a cursor kind, depending on the other fetch options and the result set structure. |
|
A driver uses a default client side cursor. A default cursor produces the records snapshot, as they were at query execution time. May give maximum fetch performance, but requires more time to return the first record, because all result set records are sent to the client at Open call. Some DBMSs support only a single active default cursor per connection. |
|
A driver uses a dynamic server side cursor. Dynamic cursor rows may be affected by the updates to the query tables, while the cursor is active. May require less time to return the first record and more time to return all records. |
|
A driver uses a static server side cursor. A static cursor produces the records snapshot, as they were at query execution time. The fetch performance may be similar to that of the dynamic cursor. |
|
A driver uses a forward only server side cursor. For FireDAC, forward only cursors are similar to dynamic or static cursors. To control FireDAC dataset scrolling abilities, use the Unidirectional property. |
The default value is ckAutomatic
.
Most of the FireDAC drivers support only some cursor types or they do not use this option at all. For details, consult the DBMS documentation. FireDAC chooses the actual cursor kind, when CursorKind = ckAutomatic
, as the following:
DBMS |
Conditions |
Actual cursor kind |
---|---|---|
Microsoft SQL Server |
|
Default cursor. |
|
Otherwise. |
Static cursor. |
IBM DB2 |
-- |
Forward only cursor. |
Sybase SQL Anywhere,Microsoft Access |
If the result set has BLOB fields. |
Dynamic cursor. |
|
Otherwise. |
Default cursor. |
PostgreSQL |
If the Mode is |
Default cursor. |
|
Otherwise |
Static cursor. |
Others |
-- |
Default cursor. |
For TFDTable, ckAutomatic enables live data window, when a table has unique identifying fields. ckDynamic
enables live data window unconditionally, and an exception is raised if a DB table does not have a unique key. Other cursor types disable the live data window mode and set TFDTable to standard mode, when it acts like TFDQuery.