Chapter 25: Sending Result Sets
This section briefly summarizes how PowerBuilder components return result sets. For detailed instructions, see the Application Techniques manual in the PowerBuilder documentation.
PowerBuilder components use DataStore objects to store and manipulate result sets. The DataStore works like a DataWindow object, except that it has no visual attributes.
Result sets are returned and retrieved using these PowerBuilder objects:
ResultSet Represents a single result set to be returned to the client. You cannot directly manipulate the contents. Instead, call the DataStore functions discussed below to populate a ResultSet from the contents of a DataStore or vice-versa. Methods in the component interface that return the TabularResults::ResultSet IDL type are represented by PowerBuilder functions that return ResultSet.
ResultSets Holds a list of 0 or more ResultSet instances; the list is stored as the ResultSetList property. Methods in the component interface that return the TabularResults::ResultSets IDL type are represented by PowerBuilder functions that return ResultSets.
You can retrieve result sets from a remote database and forward them to a client as follows:
When results are ready to be retrieved, associate the transaction object with a DataStore instance by calling the DataStore.SetTransObject function.
Populate the DataStore by calling the Retrieve function.
Call the DataStore.GenerateResultSet function and assign the returned object to a ResultSet instance.
If the method returns ResultSets, add the result set to the list in the ResultSets.ResultSetList property. Otherwise, return the result set directly.
|Copyright © 2005. Sybase Inc. All rights reserved.|