From Appmethod Libraries
Jump to: navigation, search

Object Pascal

property CursorKind: TFDCursorKind read GetCursor write SetCursor  stored IsCKS default ckAutomatic;


__property TFDCursorKind CursorKind = {read=GetCursor, write=SetCursor, stored=IsCKS, default=0};


Type Visibility Source Unit Parent
property published
FireDAC.Stan.Option TFDFetchOptions


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.




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:



Actual cursor kind 

Microsoft SQL Server 

  • If the server version is 2005 or higher.
  • Or the Mode is fmExactRecsMax or fmAll.
  • Or DirectExecute is set to True

Default cursor. 



Static cursor. 



Forward only cursor. 

Sybase SQL Anywhere,Microsoft Access 

If the result set has BLOB fields. 

Dynamic cursor. 



Default cursor. 


If the Mode is fmExactRecsMax or fmAll

Default cursor. 



Static cursor. 



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.

See Also