1<!--$Id: cursor.so,v 10.21 2003/10/18 19:15:52 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: Cursor operations</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<a name="2"><!--meow--></a>
12<table width="100%"><tr valign=top>
13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Access Methods</dl></b></td>
14<td align=right><a href="../am/second.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../am/curget.html"><img src="../../images/next.gif" alt="Next"></a>
15</td></tr></table>
16<p align=center><b>Cursor operations</b></p>
17<p>A database cursor refers to a single key/data pair in the database.  It
18supports traversal of the database and is the only way to access
19individual duplicate data items.  Cursors are used for operating on
20collections of records, for iterating over a database, and for saving
21handles to individual records, so that they can be modified after they
22have been read.</p>
23<p>The <a href="../../api_c/db_cursor.html">DB-&gt;cursor</a> method opens a cursor into a database.  Upon return the
24cursor is uninitialized, cursor positioning occurs as part of the first
25cursor operation.</p>
26<p>Once a database cursor has been opened, records may be retrieved
27(<a href="../../api_c/dbc_get.html">DBcursor-&gt;get</a>), stored (<a href="../../api_c/dbc_put.html">DBcursor-&gt;put</a>), and deleted
28(<a href="../../api_c/dbc_del.html">DBcursor-&gt;del</a>).</p>
29<p>Additional operations supported by the cursor handle include duplication
30(<a href="../../api_c/dbc_dup.html">DBcursor-&gt;dup</a>), equality join (<a href="../../api_c/db_join.html">DB-&gt;join</a>), and a count of
31duplicate data items (<a href="../../api_c/dbc_count.html">DBcursor-&gt;count</a>).  Cursors are eventually closed
32using <a href="../../api_c/dbc_close.html">DBcursor-&gt;close</a>.</p>
33<!--$Id: m4.methods,v 1.5 2007/05/08 21:37:19 bostic Exp $-->
34<table border=1 align=center>
35<tr><th>Database Cursors and Related Methods</th><th>Description</th></tr>
36<!--Db::cursor--><tr><td><a href="../../api_c/db_cursor.html">DB-&gt;cursor</a></td><td>Create a cursor</td></tr>
37<!--DbCursor::close--><tr><td><a href="../../api_c/dbc_close.html">DBcursor-&gt;close</a></td><td>Close a cursor</td></tr>
38<!--DbCursor::count--><tr><td><a href="../../api_c/dbc_count.html">DBcursor-&gt;count</a></td><td>Return count of duplicates</td></tr>
39<!--DbCursor::del--><tr><td><a href="../../api_c/dbc_del.html">DBcursor-&gt;del</a></td><td>Delete by cursor</td></tr>
40<!--DbCursor::dup--><tr><td><a href="../../api_c/dbc_dup.html">DBcursor-&gt;dup</a></td><td>Duplicate a cursor</td></tr>
41<!--DbCursor::get--><tr><td><a href="../../api_c/dbc_get.html">DBcursor-&gt;get</a>, <a href="../../api_c/dbc_get.html">DBcursor-&gt;pget</a></td><td>Retrieve by cursor</td></tr>
42<!--DbCursor::put--><tr><td><a href="../../api_c/dbc_put.html">DBcursor-&gt;put</a></td><td>Store by cursor</td></tr>
43<!--DbCursor::set_priority--><tr><td><a href="../../api_c/dbc_set_priority.html">DBcursor-&gt;set_priority</a></td><td>Set the cursor's cache priority</td></tr>
44</table>
45<table width="100%"><tr><td><br></td><td align=right><a href="../am/second.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../am/curget.html"><img src="../../images/next.gif" alt="Next"></a>
46</td></tr></table>
47<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
48</body>
49</html>
50