Debian Codegraph @

docs/api_reference/C/dbccount.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DBcursor-&gt;count()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
10 <link rel="up" href="dbc.html" title="Chapter 3.  The DBcursor Handle" />
11 <link rel="prev" href="dbccmp.html" title="DBcursor-&gt;cmp()" />
12 <link rel="next" href="dbcdel.html" title="DBcursor-&gt;del()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DBcursor-&gt;count()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="dbccmp.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 3. 
26 The DBcursor Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="dbcdel.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="dbccount"></a>DBcursor-&gt;count()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DBcursor-&gt;count(DBC *DBcursor, db_recno_t *countp, u_int32_t flags); </pre>
45 <p>
46 The <code class="methodname">DBcursor-&gt;count()</code> method returns a count of the number of data
47 items for the key to which the cursor refers.
48 </p>
49 <p>
50 The <code class="methodname">DBcursor-&gt;count()</code> <span>
51 <span>
52 method returns a non-zero error value on failure and 0 on success.
53 </span>
54
55 </span>
56 </p>
57 <div class="sect2" lang="en" xml:lang="en">
58 <div class="titlepage">
59 <div>
60 <div>
61 <h3 class="title"><a id="idp50845360"></a>Parameters</h3>
62 </div>
63 </div>
64 </div>
65 <div class="sect3" lang="en" xml:lang="en">
66 <div class="titlepage">
67 <div>
68 <div>
69 <h4 class="title"><a id="idp50849008"></a>countp</h4>
70 </div>
71 </div>
72 </div>
73 <p>
74 The <span class="bold"><strong>countp</strong></span> parameter references
75 memory into which the count of the number of duplicate data items is
76 copied.
77 </p>
78 </div>
79 <div class="sect3" lang="en" xml:lang="en">
80 <div class="titlepage">
81 <div>
82 <div>
83 <h4 class="title"><a id="idp50802104"></a>flags</h4>
84 </div>
85 </div>
86 </div>
87 <p>
88 The <span class="bold"><strong>flags</strong></span> parameter is currently
89 unused, and must be set to 0.
90 </p>
91 </div>
92 </div>
93 <div class="sect2" lang="en" xml:lang="en">
94 <div class="titlepage">
95 <div>
96 <div>
97 <h3 class="title"><a id="idp50851832"></a>Errors</h3>
98 </div>
99 </div>
100 </div>
101 <p>
102 The <code class="methodname">DBcursor-&gt;count()</code> <span>
103 <span>
104 method may fail and return one of the following non-zero errors:
105 </span>
106
107 </span>
108 </p>
109 <div class="sect3" lang="en" xml:lang="en">
110 <div class="titlepage">
111 <div>
112 <div>
113 <h4 class="title"><a id="idp50829408"></a> DB_REP_HANDLE_DEAD</h4>
114 </div>
115 </div>
116 </div>
117 <p>
118 When a client synchronizes with the master, it is possible for committed
119 transactions to be rolled back. This invalidates all the database and cursor
120 handles opened in the replication environment. Once this occurs, an attempt to use
121 such a handle will
122
123 return <code class="literal">DB_REP_HANDLE_DEAD</code>.
124 The application will need to discard the handle and open a new one in order to
125 continue processing.
126 </p>
127 </div>
128 <div class="sect3" lang="en" xml:lang="en">
129 <div class="titlepage">
130 <div>
131 <div>
132 <h4 class="title"><a id="idp50832336"></a>DB_REP_LOCKOUT</h4>
133 </div>
134 </div>
135 </div>
136 <p>
137 The operation was blocked by client/master synchronization.
138 </p>
139 </div>
140 <div class="sect3" lang="en" xml:lang="en">
141 <div class="titlepage">
142 <div>
143 <div>
144 <h4 class="title"><a id="idp50856896"></a>EINVAL</h4>
145 </div>
146 </div>
147 </div>
148 <p>
149 If the cursor has not been initialized; or if an invalid flag value or parameter was specified.
150 </p>
151 </div>
152 </div>
153 <div class="sect2" lang="en" xml:lang="en">
154 <div class="titlepage">
155 <div>
156 <div>
157 <h3 class="title"><a id="idp50831128"></a>Class</h3>
158 </div>
159 </div>
160 </div>
161 <p>
162 <a class="link" href="dbc.html" title="Chapter 3.  The DBcursor Handle">DBcursor</a>
163 </p>
164 </div>
165 <div class="sect2" lang="en" xml:lang="en">
166 <div class="titlepage">
167 <div>
168 <div>
169 <h3 class="title"><a id="idp50825216"></a>See Also</h3>
170 </div>
171 </div>
172 </div>
173 <p>
174 <a class="xref" href="dbc.html#dbclist" title="Database Cursors and Related Methods">Database Cursors and Related Methods</a>
175 </p>
176 </div>
177 </div>
178 <div class="navfooter">
179 <hr />
180 <table width="100%" summary="Navigation footer">
181 <tr>
182 <td width="40%" align="left"><a accesskey="p" href="dbccmp.html">Prev</a> </td>
183 <td width="20%" align="center">
184 <a accesskey="u" href="dbc.html">Up</a>
185 </td>
186 <td width="40%" align="right"> <a accesskey="n" href="dbcdel.html">Next</a></td>
187 </tr>
188 <tr>
189 <td width="40%" align="left" valign="top">DBcursor-&gt;cmp() </td>
190 <td width="20%" align="center">
191 <a accesskey="h" href="index.html">Home</a>
192 </td>
193 <td width="40%" align="right" valign="top"> DBcursor-&gt;del()</td>
194 </tr>
195 </table>
196 </div>
197 </body>
198 </html>