cursor.html   [plain text]


<!--$Id: cursor.so,v 10.21 2003/10/18 19:15:52 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Cursor operations</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Access Methods</dl></b></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>
</td></tr></table>
<p align=center><b>Cursor operations</b></p>
<p>A database cursor refers to a single key/data pair in the database.  It
supports traversal of the database and is the only way to access
individual duplicate data items.  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.</p>
<p>The <a href="../../api_c/db_cursor.html">DB-&gt;cursor</a> method opens a cursor into a database.  Upon return the
cursor is uninitialized, cursor positioning occurs as part of the first
cursor operation.</p>
<p>Once a database cursor has been opened, records may be retrieved
(<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
(<a href="../../api_c/dbc_del.html">DBcursor-&gt;del</a>).</p>
<p>Additional operations supported by the cursor handle include duplication
(<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
duplicate data items (<a href="../../api_c/dbc_count.html">DBcursor-&gt;count</a>).  Cursors are eventually closed
using <a href="../../api_c/dbc_close.html">DBcursor-&gt;close</a>.</p>
<!--$Id: m4.methods,v 1.5 2007/05/08 21:37:19 bostic Exp $-->
<table border=1 align=center>
<tr><th>Database Cursors and Related Methods</th><th>Description</th></tr>
<!--Db::cursor--><tr><td><a href="../../api_c/db_cursor.html">DB-&gt;cursor</a></td><td>Create a cursor</td></tr>
<!--DbCursor::close--><tr><td><a href="../../api_c/dbc_close.html">DBcursor-&gt;close</a></td><td>Close a cursor</td></tr>
<!--DbCursor::count--><tr><td><a href="../../api_c/dbc_count.html">DBcursor-&gt;count</a></td><td>Return count of duplicates</td></tr>
<!--DbCursor::del--><tr><td><a href="../../api_c/dbc_del.html">DBcursor-&gt;del</a></td><td>Delete by cursor</td></tr>
<!--DbCursor::dup--><tr><td><a href="../../api_c/dbc_dup.html">DBcursor-&gt;dup</a></td><td>Duplicate a cursor</td></tr>
<!--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>
<!--DbCursor::put--><tr><td><a href="../../api_c/dbc_put.html">DBcursor-&gt;put</a></td><td>Store by cursor</td></tr>
<!--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>
</table>
<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>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>