Try OpenEdge Now
skip to main content
ProDataSets
Introducing the OpenEdge DataSet : Populating a ProDataSet
 

Populating a ProDataSet

To populate the ProDataSet's tables in a uniform way, there is a FILL method that you can apply to either the ProDataSet as a whole or to a member buffer. Before you do a FILL, you must prepare a query for each top-level table you are filling. If you do not do this, then that table is filled with all records from its Data-Source. Even when you are using a static query for a table, you must use the dynamic QUERY-PREPARE method to define the selection criteria for it. The AVM cannot associate a static OPEN QUERY statement with a ProDataSet.
For example, to fill the dsOrder ProDataSet with Order number 1 and all its OrderLines and Items, you prepare this query on the query you have associated with that temp-table:
QUERY qOrder:QUERY-PREPARE("FOR EACH Order WHERE Order.OrderNum = 1, " +
  "FIRST Customer OF Order, FIRST SalesRep OF Order").
The AVM opens the query for you when you start the FILL. If the Data-Relation describes the parent-child relationships for children of the top-level table, then you do not need to define or prepare an explicit query for them.
* Filling the entire ProDataSet
* Partially filling a ProDataSet
* Defining a query on a child table
* Recursively filling a ProDataSet
* Summary of a FILL
* Controlling the filling of each table
* Testing the Order ProDataSet