*I:Berkeley DB Reference Guide: Access Methods[P4

Berkeley DB Reference Guide: Access Methods



(

Retrieving records



bThe DB->get function is the standard function for retrievingDrecords from the database. In general, the get function takes a key2and returns the associated data from the database.

>There are a few flags that you can set to customize retrieval:

Š

DB_GET_BOTH
Search for a matching key and data item, i.e., only return if both>the key and the data items match those stored in the database.€

DB_RMW
Acquire write locks instead of read locks during retrieval. ThisBcan enhance performance in threaded applications where deadlock is a concern.Ž

DB_SET_RECNO
If the underlying database is a Btree, and was configured so that itFis possible to search it by logical record number, retrieve a specificrecord.


AIf the database has been configured to support duplicate records,eDB->get will always return the first data item in the duplicateset.

EAEÿÿ