Subject | Ordered result from selectable stored procedure |
---|---|
Author | Rick Debay |
Post date | 2006-10-05T16:41:54Z |
Is my understanding of this correct?
If the results from a selectable stored procedure are ordered, then all
results are retrieved from the procedure before the first result can be
processed. If the results are not ordered, then the first result will
be available after the selectable SP executes SUSPEND.
FOR SELECT COL1 FROM SP(:PARAM) ORDER BY COL1 INTO :X
DO BEGIN
-- entire result set will have been retrieved in the first iteration
END
FOR SELECT COL1 FROM SP(:PARAM) INTO :X
DO BEGIN
-- only first item will have been retrieved in the first iteration
END
If the results from a selectable stored procedure are ordered, then all
results are retrieved from the procedure before the first result can be
processed. If the results are not ordered, then the first result will
be available after the selectable SP executes SUSPEND.
FOR SELECT COL1 FROM SP(:PARAM) ORDER BY COL1 INTO :X
DO BEGIN
-- entire result set will have been retrieved in the first iteration
END
FOR SELECT COL1 FROM SP(:PARAM) INTO :X
DO BEGIN
-- only first item will have been retrieved in the first iteration
END