Try OpenEdge Now
skip to main content
ProDataSets
Advanced Events and Attributes : Buffer BATCH-SIZE and LAST-BATCH attributes : NEXT-ROWID attribute
 

NEXT-ROWID attribute

The NEXT-ROWID attribute is of data-type ROWID, and is supported for each buffer in a Data-Source.
NEXT-ROWID is set by the AVM whenever a FILL is done. If the BATCH-SIZE attribute is not set for the Data-Source buffers, or the FILL completes the source query selection without running into a BATCH-SIZE limitation, NEXT-ROWID is set to the Unknown value (?). If the FILL runs into a BATCH-SIZE limitation, NEXT-ROWID is set to the ROWID of the next record in the selection for that source buffer. If there are multiple source buffers for a single ProDataSet row, then the NEXT-ROWID attribute is set for each of them. It is accessed through the Data-Source handle by specifying the buffer sequence number or buffer name, as shown with this syntax:

Syntax

data-source-handle:NEXT-ROWID( buffer-sequence-number | buffer-name )
The buffer-sequence-number is an INTEGER that represents the sequence number of the desired buffer. The buffer-name is a CHARACTER expression that evaluates to the name of a buffer in the Data-Source object. If no buffer-sequence-number or buffer-name is given, the attribute defaults to the first (or only) buffer in the Data-Source.
Like LAST-BATCH, NEXT-ROWID is intended for a temp-table that is either at the top of a ProDataSet relation hierarchy, or has at most one parent record at each level above the buffer that it applies to. This is because the attribute value is set only once for each buffer in each FILL. If a single FILL requires batching for children of multiple different parents, the value of NEXT-ROWID is set for each one in turn, so that the final value reflects only the NEXT-ROWID for the children of the last parent retrieved. If there is a need to capture NEXT-ROWID for multiple sets of dependent records during the FILL, then some other event handler is needed – for example an AFTER-ROW-FILL event procedure for the parent buffer, which can then store NEXT-ROWID into an array or some other field where is can later be retrieved and dealt with programmatically.
The NEXT-ROWID attribute is read-write. The default is the Unknown value (?). NEXT-ROWID is read/write because the application procedure may need to set NEXT-ROWID if the code is not using the FILL method, but instead is reading the source data from a flat file or some other unmanaged data store. Otherwise, this attribute is normally set by the AVM, not by the application.