June 2001
Intermediate to advanced
688 pages
19h 18m
English
#include <db.h> int DB→get(DB *db, DB_TXN *txnid, DBT *key, DBT *data, u_int32_t flags);
The DB→get function retrieves key/data pairs from the database. The address and length of the data associated with the specified key are returned in the structure referenced by data.
In the presence of duplicate key values, DB→get will return the first data item for the designated key. Duplicates are sorted by insert order, except where this order has been overridden by cursor operations. Retrieval of duplicates requires the use of cursor operations. See DBcursor→c_get for details.
If the operation is to be transaction-protected, the txnid parameter is a transaction handle returned from txn_begin; otherwise, NULL.
The flags parameter ...