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

Berkeley DB Reference Guide: Access Methods



3

Duplicate data items (DB_DUP)



GThe Hash access method supports the creation of multiple data items forFa single key item. By default, multiple data items are not supported,Gand each database store operation will overwrite any previous data itemIfor that key. To configure Berkeley DB for duplicate data items, set theWDB_DUP flag in the DB_INFO structure.

JWhen stepping through the database sequentially, duplicate data items willEbe returned individually, as a key/data pair, where the key item onlyFchanges when the last duplicate data item has been returned. For thisgreason, duplicate data items cannot be accessed using the DB->getEfunction, as it always returns the first of the duplicate data items.ODuplicate data items should be retrieved using the Berkeley DB cursor function,7DBcursor->c_get.

IAJÿÿ