Opens next rowset in the statement.
function OpenNext: boolean;
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.
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;