Consultor Eletrônico



Kbase P31855: How to identify record number within a database block?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/23/2010
Status: Verified

GOAL:

How to identify record number within a database block?

GOAL:

How to determine where record is in the database block?

GOAL:

How to determine record in the block?

GOAL:

Where is a record in a block?

FACT(s) (Environment):

All Supported Operating Systems
Progress/OpenEdge Product Family

FIX:

The RECID can be used to identify where a record exists in a database
block. There are two ways to calculate this value:

1. Take the recid and divide it by the # of records per block for
the area where this record is located in. Then multiply the remainder
portion only by # of records per block.

Example:

RECID = 5305
# Records per Block = 64
5305 / 64 = 82.890625
82 (is the Database block #)
.890625 x 64 = 57 (the record number within the block)

OR


2. Take the recid and convert it to binary.
Then determine rec bits for the area. Use this value to identify
a hex representation of the record number within the block.

For additional information on determining rec bits please see solution
P31638, "How to convert a RECID to a Database
Block Number by using Rec Bits"

Example:

RECID = 5305
Rec Bits = 6
RECID 5305 in binary is 1010010111001
^^^^^^ (Convert to decimal = 57 record number)
^^^^^^^ (Convert to decimal = 82 for Database block #)