Fetching multiple datasets

Some stored procedures return multiple sets of records. The dataset only fetches the first set when you open it. In order to access the other sets of records, call the NextRecordSet method:

DataSet2: TCustomSQLDataSet; nRows: Integer; begin

DataSet2 := SQLStoredProcl.NextRecordSet;

NextRecordSet returns a newly created TCustomSQLDataSet component that provides access to the next set of records. That is, the first time you call NextRecordSet, it returns a dataset for the second set of records. Calling NextRecordSet returns a third dataset, and so on, until there are no more sets of records. When there are no additional datasets, NextRecordSet returns nil.

Executing commands that do not return records

+1 0

Post a comment