MyDAC

TCustomMyDataSet.OpenNext Method

Opens next rowset in the statement.

Class

TCustomMyDataSet

Syntax

function OpenNext: boolean;

Return Value
True, if DataSet opens.

Remarks

Call the OpenNext method to get the second and other ResultSets while executing a multiresult query. If DataSet opens, it returns True. If there are no record sets to be represented, it will return False, and the current record set will be closed. Has effect only for the ctDefaultResultSet cursor. The OpenNext method isn't compatible with TCustomDADataSet.Prepare.

Example

MyQuery.SQL.Clear;
   MyQuery.SQL.Add('SELECT * FROM Table1;');
   MyQuery.SQL.Add('SELECT * FROM Table2;');
   MyQuery.SQL.Add('SELECT * FROM Table3;');
   MyQuery.SQL.Add('SELECT * FROM Table4;');
   MyQuery.SQL.Add('SELECT * FROM Table5;');
   MyQuery.FetchAll := False;
   MyQuery.Open;
   repeat
      //   < do something >
until not MyQuery.OpenNext; 

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback