E@DBLOCKNXTRNG
Name
The E@DBLOCKNXTRNG call has the following format:
DN@<Logical>(E@DBLOCKNXTRNG)
where <Logical> identifies the database file to use to perform the E@DBLOCKNXTRNG call.
Description
When you need to update a range of data without interruption, E@DBLOCKNXTRNG retrieves the next database record in a range and prepares it for updating by an E@DBSTORE call.
Using the API in a Program
You must precede E@DBLOCKNXTRNG with E@DBLOCKBEGRNG, E@DBLOCKSUBRNG, E@DBLOCKMIDRNG, or E@DBLOCKMIDSUB.
Input Values
Field | Description |
---|---|
<Logical> | You must specify the database index name that you want to create a record in. |
Record retrieval variables (also known as D@ fields) |
You must populate the index key fields used to locate the record before using this call. Fill in only the D@ fields that define the appropriate range; leave empty those D@ fields that do not define the range. |
E@DBBEGRNG | Move a number into E@DBBEGRNG in order to tell the interface which key is the last significant one defining the range. This number is equivalent to the position of the field in the index. |
Return Values
Field | Description |
---|---|
D<prefix>@NOTFOUND – or – E@KEY@FOUND |
The Modify routines set D<prefix>@NOTFOUND to FALSE if a record is found, TRUE if a record is not found, or E@KEY@FOUND if the keys are found. |
Programming Example
The following example shows how to update a series of records in a file.
|
Comparing this example to the routine that uses E@DBLOCKGE and E@DBLOCKNXT shows two major usage differences:
-
You do not have to fill the extra index key with blanks. Instead, the E@DBBEGRNG variable identifies the last key to be used as a delimiter.
-
You no longer need to use the extra OR check on the D@field in the DOW clause. The interface performs the check.
You can also use a E@DBKFNDBEGRNG, E@DBFINDSUBRNG and E@DBFINDPRVRNG loop for updates with an E@DBLOCKEQ. If your use the find loop versus a modify loop, the E@DBLOCKEQ must be a different index than that used on the FIND loop.