Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > 38d9966b2e862f62a2028762250d72f3 > files > 13

ruby-bdb-0.6.5-3.fc12.i686.rpm

<?xml version="1.0" ?>
<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>docs/cursor.rd</title>
</head>
<body>
<h2><a name="label-0" id="label-0">Cursor operation</a></h2><!-- RDLabel: "Cursor operation" -->
<p>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.</p>
<p>See also iterators in <a href="docs/access.html#each">Acces Methods</a></p>
<h3><a name="label-1" id="label-1">Methods</a></h3><!-- RDLabel: "Methods" -->
<dl>
<dt><a name="label-2" id="label-2"><code>close()</code></a></dt><!-- RDLabel: "close" -->
<dt><a name="label-3" id="label-3"><code>c_close()</code></a></dt><!-- RDLabel: "c_close" -->
<dd>
Discards the cursor.</dd>
<dt><a name="label-4" id="label-4"><code>count()</code></a></dt><!-- RDLabel: "count" -->
<dt><a name="label-5" id="label-5"><code>c_count()</code></a></dt><!-- RDLabel: "c_count" -->
<dd>
Return the count of duplicate</dd>
<dt><a name="label-6" id="label-6"><code>current()</code></a></dt><!-- RDLabel: "current" -->
<dt><a name="label-7" id="label-7"><code>c_current()</code></a></dt><!-- RDLabel: "c_current" -->
<dd>
Same than <code>get(BDB::CURRENT)</code></dd>
<dt><a name="label-8" id="label-8"><code>del()</code></a></dt><!-- RDLabel: "del" -->
<dt><a name="label-9" id="label-9"><code>delete()</code></a></dt><!-- RDLabel: "delete" -->
<dt><a name="label-10" id="label-10"><code>c_del()</code></a></dt><!-- RDLabel: "c_del" -->
<dd>
Deletes the key/data pair currently referenced by the cursor.</dd>
<dt><a name="label-11" id="label-11"><code>dup(<var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "dup" -->
<dt><a name="label-12" id="label-12"><code>clone(<var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "clone" -->
<dt><a name="label-13" id="label-13"><code>c_dup(<var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "c_dup" -->
<dt><a name="label-14" id="label-14"><code>c_clone(<var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "c_clone" -->
<dd>
<p>Creates new cursor that uses the same transaction and locker ID as
the original cursor. This is useful when an application is using
locking and requires two or more cursors in the same thread of
control.</p>
<p><var>flags</var> can have the value <var>BDB::DB_POSITION</var>, in this case the
newly created cursor is initialized to reference the same position in
the database as the original cursor and hold the same locks.</p></dd>
<dt><a name="label-15" id="label-15"><code>first()</code></a></dt><!-- RDLabel: "first" -->
<dt><a name="label-16" id="label-16"><code>c_first()</code></a></dt><!-- RDLabel: "c_first" -->
<dd>
Same than <code>get(BDB::FIRST)</code></dd>
<dt><a name="label-17" id="label-17"><code>get(<var>flags</var>, <var>key</var> = <var>nil</var>, <var>value</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "get" -->
<dt><a name="label-18" id="label-18"><code>c_get(<var>flags</var>, <var>key</var> = <var>nil</var>, <var>value</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "c_get" -->
<dd>
<p>Retrieve key/data pair from the database</p>
<p>See the description of <code>c_get</code> in the Berkeley distribution
for the different values of the <var>flags</var> parameter.</p>
<p><var>key</var> must be given if the <var>flags</var> parameter is 
<var>BDB::SET</var> | <var>BDB::SET_RANGE</var> | <var>BDB::SET_RECNO</var></p>
<p><var>key</var> and <var>value</var> must be specified for <var>BDB::GET_BOTH</var></p></dd>
<dt><a name="label-19" id="label-19"><code>last()</code></a></dt><!-- RDLabel: "last" -->
<dt><a name="label-20" id="label-20"><code>c_last()</code></a></dt><!-- RDLabel: "c_last" -->
<dd>
Same than <code>get(BDB::LAST)</code></dd>
<dt><a name="label-21" id="label-21"><code>next()</code></a></dt><!-- RDLabel: "next" -->
<dt><a name="label-22" id="label-22"><code>c_next()</code></a></dt><!-- RDLabel: "c_next" -->
<dd>
Same than <code>get(BDB::NEXT)</code></dd>
<dt><a name="label-23" id="label-23"><code>pget(<var>flags</var>, <var>key</var> = <var>nil</var>, <var>value</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "pget" -->
<dt><a name="label-24" id="label-24"><code>c_pget(<var>flags</var>, <var>key</var> = <var>nil</var>, <var>value</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "c_pget" -->
<dd>
Retrieve key/primary key/data pair from the database</dd>
<dt><a name="label-25" id="label-25"><code>prev()</code></a></dt><!-- RDLabel: "prev" -->
<dt><a name="label-26" id="label-26"><code>c_prev()</code></a></dt><!-- RDLabel: "c_prev" -->
<dd>
Same than <code>get(BDB::PREV)</code></dd>
<dt><a name="label-27" id="label-27"><code>put(<var>flags</var>, <var>value</var>)</code></a></dt><!-- RDLabel: "put" -->
<dt><a name="label-28" id="label-28"><code>c_put(<var>flags</var>, <var>value</var>)</code></a></dt><!-- RDLabel: "c_put" -->
<dd>
<p>Stores data value into the database.</p>
<p>See the description of <code>c_put</code> in the Berkeley distribution
for the different values of the <var>flags</var> parameter.</p></dd>
<dt><a name="label-29" id="label-29"><code>put(<var>flags</var>, <var>key</var>, <var>value</var>)</code></a></dt><!-- RDLabel: "put" -->
<dt><a name="label-30" id="label-30"><code>c_put(<var>flags</var>, <var>key</var>, <var>value</var>)</code></a></dt><!-- RDLabel: "c_put" -->
<dd>
<p>Stores key/data pairs into the database (only for Btree and Hash
access methods)</p>
<p><var>flags</var> must have the value <var>BDB::KEYFIRST</var> or
<var>BDB::KEYLAST</var></p></dd>
<dt><a name="label-31" id="label-31"><code>set(<var>key</var>)</code></a></dt><!-- RDLabel: "set" -->
<dt><a name="label-32" id="label-32"><code>c_set(<var>key</var>)</code></a></dt><!-- RDLabel: "c_set" -->
<dt><a name="label-33" id="label-33"><code>set_range(<var>key</var>)</code></a></dt><!-- RDLabel: "set_range" -->
<dt><a name="label-34" id="label-34"><code>c_set_range(<var>key</var>)</code></a></dt><!-- RDLabel: "c_set_range" -->
<dt><a name="label-35" id="label-35"><code>set_recno(<var>key</var>)</code></a></dt><!-- RDLabel: "set_recno" -->
<dt><a name="label-36" id="label-36"><code>c_set_recno(<var>key</var>)</code></a></dt><!-- RDLabel: "c_set_recno" -->
<dd>
Same than <code>get</code> with the flags <var>BDB::SET</var> or <var>BDB::SET_RANGE</var>
or <var>BDB::SET_RECNO</var></dd>
</dl>

</body>
</html>