Try OpenEdge Now
skip to main content
Batching Data with ProDataSets : Using the include-field list to limit the fields copied into the table

Using the include-field list to limit the fields copied into the table

You must make use of the field list passed in to limit the number of fields that are copied into the ttOrder temp-table.
Edit the ATTACH-DATA-SOURCE method for the ttOrder table in preOrderFill to use cFieldList as the value for the include field list.
The first of the optional arguments to ATTACH-DATA-SOURCE following the Data-Source handle is the field mapping for fields whose names are changed. This argument is in the following example:
PROCEDURE preOrderFill:

    "Customer.Name,CustName", ?, cFieldList ).
END PROCEDURE. /* preOrderFill */
The second and third optional arguments are a list of fields to exclude from the temp-table and a list of fields to include. You can specify one of these but not both.
Limiting the field values that are buffer-copied speeds up the creation of the temp-table rows somewhat. But the major reason for not filling fields that the client does not need is to cut down on the network traffic, as always anticipating the deployment situation where the support procedure is running on an AppServer and the window on a separate client machine. The field values that are not buffer-copied into the temp-table will be null, blank, or 0, unless the field has another specific initial value. Even though these values do go across to the client, this greatly reduces the number of bytes of data being passed.