Provides second and other result sets while executing multiresult query.
function OpenNext: boolean;
Call the OpenNext method to get second and other result sets while executing 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.
Here is a small piece of code that demonstrates the approach of working with multiple datasets returned by a multi-statement query:
UniQuery.SQL.Clear; UniQuery.SQL.Add('SELECT * FROM Table1;'); UniQuery.SQL.Add('SELECT * FROM Table2;'); UniQuery.SQL.Add('SELECT * FROM Table3;'); UniQuery.SQL.Add('SELECT * FROM Table4;'); UniQuery.SQL.Add('SELECT * FROM Table5;'); UniQuery.FetchAll := False; UniQuery.Open; repeat // < do something > until not UniQuery.OpenNext;