1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
<! "@(#)get.so 10.3 (Sleepycat) 10/19/98">
<!Copyright 1997, 1998 by Sleepycat Software, Inc. All rights reserved.>
<html>
<body bgcolor=white>
<head>
<title>Berkeley DB Reference Guide: Access Methods</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btr
ee,hash,hashing,transaction,transactions,locking,logging,access method,access me
thods,java,C,C++">
</head>
<h3>Berkeley DB Reference Guide: Access Methods</h3>
<p>
<h1 align=center>Retrieving records</h1>
<p>
The <a href="../../api_c/Db/get.html">DB->get</a> function is the standard function for retrieving
records from the database. In general, the get function takes a key
and returns the associated data from the database.
<p>
There are a few flags that you can set to customize retrieval:
<dl compact>
<p><dt><a href="../../api_c/Db/get.html#DB_GET_BOTH">DB_GET_BOTH</a><dd>Search for a matching key and data item, i.e., only return if both
the key and the data items match those stored in the database.
<p><dt><a href="../../api_c/Dbc/get.html#DB_RMW">DB_RMW</a><dd>Acquire write locks instead of read locks during retrieval. This
can enhance performance in threaded applications where deadlock is
a concern.
<p><dt><a href="../../api_c/Db/get.html#DB_SET_RECNO">DB_SET_RECNO</a><dd>If the underlying database is a Btree, and was configured so that it
is possible to search it by logical record number, retrieve a specific
record.
</dl>
<p>
If the database has been configured to support duplicate records,
<a href="../../api_c/Db/get.html">DB->get</a> will always return the first data item in the duplicate
set.
<p>
<a href="../../ref/am/ops.html"><img src="../../images/prev.gif"></a>
<a href="../../ref/toc.html"><img src="../../images/toc.gif"></a>
<a href="../../ref/am/put.html"><img src="../../images/next.gif"></a>
</tt>
</body>
</html>
|