E@DBKFNDSUBRNG
Name
The E@DBKFNDSUBRNG call has the following format:
DN@<Logical>(E@DBKFNDSUBRNG)
where <Logical> identifies the database file and index to use to perform the E@DBKFNDSUBRNG call.
Description
E@DBKFNDSUBRNG performs similarly to E@DBKFNDBEGRNG, but it allows for more precision in defining the range, because it lets you specify beginning and ending values on the last key field defining the range. The routine inquires on the database records in a range. It accesses and returns only the key fields from an index. It does not access or return whole database records from a file. Otherwise, it works as the normal range find calls work.
The database routines perform an equal condition on all D@ Index fields up to the subrange field designated in the E@DBSUBRNG. It performs a "where greater-than and less-than" condition on this index field.
Using the API in a Program
E@DBKFNDSUBRNG must be paired with a E@DBKFNDNXTRNG.
You must populate the delimiting D@ fields and E@DBBEGRNG before using E@DBKFNDSUBRNG.
You must populate the delimiting D@ fields and E@DBSUBRNG before using E@DBKFNDSUBRNG.
Input Values
Field | Description |
---|---|
<Logical> | <Logical> in the E@ statement identifies the database file and index to use to perform the call. |
Record retrieval variables (also known as D@ and D# fields) | Define the beginning and ending values of the last key by moving the appropriate values to the record retrieval fields named D@<KeyFieldName> and D#END#<KeyFieldName>. |
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. |
E@DBSUBRNG | Move a number into E@DBSUBRNG 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 |
Each routine sets the logical value <FileName>-NOTFOUND or <FileName>-FOUND based on the outcome of the read process. The Find 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
For an example of programming, see E@DBFINDSUBRNG.