Berkeley DB Reference Guide: Storing records
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

### Berkeley DB Reference Guide: Access Methods |

# Storing records

The DB->put function is the standard interface for storing records into the database. In general, DB->put takes a key and stores the associated data into the database.

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

DB_APPEND
  Simply append the data to the end of the database, treating the database much like a simple log. This flag is only valid for the Queue and Recno access methods.

DB_NOOVERWRITE
  Only store the data item if the key does not already appear in the database.

If the database has been configured to support duplicate records, the DB->put function will add the new data value at the end of the duplicate set. If the database supports sorted duplicates, the new data value is inserted at the correct sorted location.

Copyright Sleepycat Software