Berkeley DB Reference Guide: Access Methods
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 |

# Database cursors

A database cursor is a sequential pointer to the database entries. It allows traversal of the database and access to duplicate keyed entries. Cursors are used for operating on collections of records, for iterating over a database, and for saving handles to individual records, so that they can be modified after they have been read.

The DB->cursor function is the standard interface for opening a cursor into a database. Upon return the cursor is not initialized to point to any location. Positioning occurs as part of the first cursor operation.

Once a database cursor has been opened, there are five additional standard access method operations that can be performed. Each of these operations is performed using a method that is referenced from the returned cursor handle.

DBcursor->c_close
  Close the cursor
DBcursor->c_del
  Delete a record
DBcursor->c_dup
  Duplicate a cursor
DBcursor->c_get
  Retrieve a record
DBcursor->c_put
  Store a record

Copyright Sleepycat Software