With the implementation of table partitioning in OpenEdge, the current rowid information plus the table number is no longer sufficient to uniquely identify a specific record in the database. Uniqueness is obtained by also including the partition id associated with the record. The internal format of a ROWID has been extended to include the partition information. The information associated with a RECID only contains the encoded block and record within block information.
An ABL class can generate all possible ROWID values for any or all partitions for a particular partitioned table. The ABL class is called RowidGenerator.cls . The Rowids class has no built package, to create one modify the .cls file and store it in the package-specific directory.
The class contains two static methods as follows:
METHOD PUBLIC STATIC VOID TableStart
(tableName AS CHAR,
startId AS INT64,
maxId AS INT64,
partitionId AS INT)
To dump the specific records, call the method
TableStart for each table using the following parameters:
tableName - the name of the table
startId - the minimum/starting ROWID value to be returned.
maxId - the maximum/ending ROWID value to be returned.
partitionId - to iterate across a range of rowids for a particular table:
To only dump the records from a single partition for this table, a specific partition Id can be passed using this parameter.
To dump all records for each defined partition of the table, pass the Unknown value.
The code assumes that it is possible to access the _Partition-Policy and _Partition-Policy-Detail records.
METHOD PUBLIC STATIC ROWID GetNextRowid()Run the code below after each call to TableStart to call GetNextRowid repeatedly until it returns an Unknown value. If there is a record that matches this ROWID, the code exports it so that it can be re-loaded into a new database.
DEFINE VARIABLE rid AS ROWID NO-UNDO.
Rowids:TableStart("<tablename>", 1408, 3000, ?).
rid = Rowids:GetNextRowid().
DO WHILE rid <> ?:
FIND <tablename> WHERE ROWID(<tablename>) = rid NO-ERROR.
IF AVAILABLE(<tablename>) THEN DO:
EXPORT <tablename>.
END.
rid = Rowids:GetNextRowid().
END.