FLAIM: Record and Key Retrieval Functions

- Main Page
- Modules
- Classes
- Files

# Record and Key Retrieval Functions
[Database Functions]

## Functions
FLMEXP RCODE FLMAPI | FlmRecordRetrieve (HFDB hDb, FLMUINT uiContainerNum, FLMUINT uiDrn, FLMUINT uiFlag, FlmRecord **ppRecord, FLMUINT *puiDrn)
| Find and retrieve a record in a container.
FLMEXP RCODE FLMAPI | FlmKeyRetrieve (HFDB hDb, FLMUINT uiIndex, FLMUINT uiContainerNum, FlmRecord *pSearchKey, FLMUINT uiSearchDrn, FLMUINT uiFlags, FlmRecord **ppFoundKey, FLMUINT *puiFoundDrn)
| Find and retrieve a key in an index.

## Function Documentation

FLMEXP RCODE FLMAPI FlmKeyRetrieve | ( | HFDB | hDb,
|  | FLMUINT | uiIndex,
|  | FLMUINT | uiContainerNum,
|  | FlmRecord * | pSearchKey,
|  | FLMUINT | uiSearchDrn,
|  | FLMUINT | uiFlags,
|  | FlmRecord ** | ppFoundKey,
|  | FLMUINT * | puiFoundDrn
| ) |

  | Find and retrieve a key in an index. Parameters:
  hDb | Database handle.
  uiIndex | Index the key is to be retrieved from.
  uiContainerNum | If the index is a cross-container index, this may be used to specify a particular container the found key should be pointing to. A value of zero indicates that any container will do.
  pSearchKey | Key to be searched for. NOTE: The actual key retrieved depends on the uiFlags parameter as well.
  uiSearchDrn | DRN in the key's reference set that is to be searched for. If a zero is passed in this parameter, only a key search is done, not a key+reference search.
  uiFlags | Flags used in conjunction with the pSearchKey and uiSearchDrn parameters to determine the key/DRN that should be retrieved. Flags may be ORed together and are as follows: FO_INCL - Return either the exact key+reference specified by pSearchKey and uiSearchDrn or the next key+reference after. NOTE: This flag may be used in conjunction with the FO_KEY_EXACT flag - see documentation below FO_EXCL - Retrieve the key+reference that comes after the key+reference specified by pSearchKey and uiSearchDrn. NOTE: This flag may be used in conjunction with the FO_KEY_EXACT flag - see documentation below FO_KEY_EXACT - This flag is used in conjunction with the FO_INCL and FO_EXCL flags. It specifies that FlmKeyRetrieve() is NOT to go to the next key in the index, but confine itself to references for the key specified in pSearchKey. If there are no more references for the key specified in pSearchKey, FlmKeyRetrieve() will return RCODE::FERR_EOF_HIT, even if there are keys that come after pSearchKey FO_EXACT - Retrieve the exact key+reference specified by pSearchKey and uiSearchDrn. If there is no such key+reference, the function should return RCODE::FERR_NOT_FOUND FO_FIRST - Retrieve the first key+reference in the index. If this flag is passed in, all other flags will be ignored, as will pSearchKey and uiSearchDrn FO_LAST - Retrieve the last key+reference in the index. If this flag is passed in, all other flags will be ignored except for FO_FIRST (which takes precedence over FO_LAST if they are both set), as will pSearchKey and uiSearchDrn
  ppFoundKey | If non-NULL, found key is returned here.
  puiFoundDrn | If non-NULL, found reference (DRN) is returned here.

FLMEXP RCODE FLMAPI FlmRecordRetrieve | ( | HFDB | hDb,
|  | FLMUINT | uiContainerNum,
|  | FLMUINT | uiDrn,
|  | FLMUINT | uiFlag,
|  | FlmRecord ** | ppRecord,
|  | FLMUINT * | puiDrn
| ) |

  | Find and retrieve a record in a container. Parameters:
  hDb | Database handle.
  uiContainerNum | Container the record is to be retrieved from.
  uiDrn | DRN of record to be retrieved. NOTE: The actual record retrieved depends on the uiFlag parameter as well.
  uiFlag | Flag that is used in conjunction with the uiDrn parameter to determine the record that should be retrieved. Flag may be one of the following: FO_INCL - If the record specified by uiDrn is not found, find the record with the next highest DRN after it FO_EXCL - Retrieve the record whose DRN is the next highest after the DRN specified in uiDrn FO_EXACT - Retrieve the record whose DRN is specified by uiDrn. If there is no record with that DRN, the function should return RCODE::FERR_NOT_FOUND FO_FIRST - Retrieve the first record in the container - the record with the lowest DRN. The uiDrn parameter is ignored if this flag is passed in FO_LAST - Retrieve the last record in the container - the record with the highest DRN. The uiDrn parameter is ignored if this flag is passed in
  ppRecord | If non-NULL, pointer to found record object is returned here.
  puiDrn | If non-NULL, DRN of found record is returned here.