FireDAC.Stan.Option.TFDFetchOptions.Mode

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Mode: TFDFetchMode read GetMode write SetMode  stored IsMS default fmOnDemand;

C++

__property TFDFetchMode Mode = {read=GetMode, write=SetMode, stored=IsMS, default=1};

Properties

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

Description

Controls how to fetch data.

Use the Mode property to control how the result set records must be fetched into the FireDAC internal data storage.

Mode 

Description 

fmManual

The records are not fetched automatically by FireDAC. A programmer must write the code to fetch records at appropriate moments, using the following methods:

  • FetchAll to fetch all records.
  • GetNextPacket to fetch the next record set (packet), containing RowsetSize records.

 

fmOnDemand 

The records are fetched automatically by FireDAC, when they are demanded by the navigation or other dataset methods. At each demand, FireDAC fetches one or more record sets, containing RowsetSize records. This mode allows you to open big result sets without a significant delay, as it happens with the fmAll mode. But the total amount of time of fetching all the records will be higher than in the fmAll mode. For example, on the Microsoft SQL Server, the server side static cursor will be used . 

fmAll

All result set records are fetched automatically by FireDAC at the dataset Open call. On a big result set, it may take some time, but the navigation through a dataset will be fast, because all records will be stored in a FireDAC internal data storage. For many DBMSs, such as a Microsoft SQL Server, MySQL Server, Sybase SQL Anywhere:

  • It releases a client result set buffer and allows you to execute the next command returning result sets.
  • Gives maximum fetch performance. For example, on Microsoft SQL Server, the fast forward-only cursor will be used.

 

fmExactRecsMax 

Similar to fmAll, but if the amount of the fetched records differs from that specified in RecsMax, then an exception is raised. 

The default value is fmOnDemand, for TFDCustomMemTable it is fmAll.

See Also