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

Berkeley DB Reference Guide: Access Methods



3

Storing records with a cursor



hThe DBcursor->c_put function is the standard function for storingErecords into the database, with a cursor. In general, the cursor putGfunction takes a key and inserts the associated data into the database.

@There are several flags that you can set to customize retrieval:

DB_AFTER
Create a new record, immediately after the record currently referenced by the cursor.

DB_BEFORE
Create a new record, immediately before the record currently referenced by the cursor.

DB_CURRENT
Replace the contents of the record currently referenced by the cursor.

DB_KEYFIRST
Create a new record, as the first of the duplicate records for the suppliedkey.

DB_KEYLAST
Create a new record, as the last of the duplicate records for the suppliedkey.


nIn all cases, the cursor is repositioned by a DBcursor->c_put operation=to point to the newly inserted key/data pair in the database.

HAH