Try OpenEdge Now
skip to main content
ProDataSets
ProDataSet Attributes and Methods : Other ProDataSet methods
 

Other ProDataSet methods

You are already familiar with the most important ProDataSet method, which is FILL. There are two other useful ProDataSet methods.
The CLEAR method destroys the entire definition of a dynamic ProDataSet, returning it to the state it was in just after the CREATE statement for it. You can then reuse the ProDataSet handle to build another dynamic ProDataSet. This method cannot be used on a static ProDataSet.
By contrast, the EMPTY-DATASET method empties all records from all the ProDataSet's tables, but does not destroy the ProDataSet definition. You can use this method on a static ProDataSet's handle or on a dynamic ProDataSet. This is similar to the EMPTY-TEMP-TABLE method for a temp-table. It is much more efficient than looping through the records and deleting them one at a time. Unless there is an active transaction, the records in each temp-table of the ProDataSet are eliminated in a single operation. If there is an active transaction, then the slower record-by-record operation is done. Normally, you should empty a ProDataSet only when there is no active transaction.