FireDAC.Comp.DataSet.TFDDataSet.GetNextPacket

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetNextPacket: Integer;

C++

int __fastcall GetNextPacket();

Properties

Type Visibility Source Unit Parent
function public
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
FireDAC.Comp.DataSet TFDDataSet

Description

Fetches the next rowset from the DBMS.

Call GetNextPacket to fetch the next rowset from a DBMS cursor. 

To specify the maximum number of records to return in a rowset, set the FetchOptions.RowsetSize property before calling GetNextPacket. A rowset is appended to the records that are already stored in the internal data storage. 

GetNextPacket returns the number of records fetched. If the return value is less than FetchOptions.RowsetSize, the dataset has already received all available records from the DBMS cursor. 

Use GetNextPacket for manual fetching mode when FetchOptions.Mode is set to fmManual.

Example

FDQuery1.FetchOptions.Mode := dmManual;
FDQuery1.SQL.Text := 'select * from mytab';
FDQuery1.Open;
// here RecordCount = 0
FDQuery1.GetNextPacket;
// here RecordCount <= FetchOptions.RowsetSize

See Also