Every member of a ProDataSet is identified by a buffer for the temp-table holding that member's data. The same buffer cannot be added to more than one ProDataSet concurrently, although a member table can be a part of more than one ProDataSet, using separate buffers for independent record currency.
You can specify one or more buffers for a dynamic ProDataSet with the SET-BUFFERS method, which has the following syntax:
These definitions apply to both the ADD-BUFFER and the SET-BUFFERS methods:
buffer-handle-expression can be either a temp-table handle or a buffer handle. If it is a temp-table handle, then the temp-table's default-buffer-handle is used as the buffer handle.
buffer-name-expression is the name of a static buffer for a temp-table scoped to the procedure that contains the statement.
Both ADD-BUFFER and SET-BUFFERS return an optional logical status, which is true if the method was successful and false if not. Use SET-BUFFERS just once to set the entire buffer list for the ProDataSet. If there were any buffers already added, SET-BUFFERS removes them first. ADD-BUFFER adds a single buffer to those already there.
If you want to reset your ProDataSet to have no buffers, you can use the following syntax:
Syntax
dataset-handle:CLEAR()
This removes all elements from the ProDataSet definition, including buffers, relations, and so on. It restores the state of the handle to exactly what it was after the CREATE DATASET statement.
As noted, by default, dynamic buffers that are added to a ProDataSet are deleted when the ProDataSet is deleted, unless you set the buffer's AUTO-DELETE attribute to false.