Debian Codegraph @

docs/api_reference/CXX/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>Dbc::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 Dbc Handle" />
11 <link rel="prev" href="dbccmp.html" title="Dbc::cmp()" />
12 <link rel="next" href="dbcdel.html" title="Dbc::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">Dbc::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 Dbc 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>Dbc::count()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 Dbc::count(db_recno_t *countp, u_int32_t flags);</pre>
45 <p>
46 The <code class="methodname">Dbc::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">Dbc::count()</code> <span>
51
52 <span>
53 method either returns a non-zero error value or throws an
54 exception that encapsulates a non-zero error value on
55 failure, and returns 0 on success.
56 </span>
57 </span>
58 </p>
59 <div class="sect2" lang="en" xml:lang="en">
60 <div class="titlepage">
61 <div>
62 <div>
63 <h3 class="title"><a id="idp6144232"></a>Parameters</h3>
64 </div>
65 </div>
66 </div>
67 <div class="sect3" lang="en" xml:lang="en">
68 <div class="titlepage">
69 <div>
70 <div>
71 <h4 class="title"><a id="idp6126760"></a>countp</h4>
72 </div>
73 </div>
74 </div>
75 <p>
76 The <span class="bold"><strong>countp</strong></span> parameter references
77 memory into which the count of the number of duplicate data items is
78 copied.
79 </p>
80 </div>
81 <div class="sect3" lang="en" xml:lang="en">
82 <div class="titlepage">
83 <div>
84 <div>
85 <h4 class="title"><a id="idp6142032"></a>flags</h4>
86 </div>
87 </div>
88 </div>
89 <p>
90 The <span class="bold"><strong>flags</strong></span> parameter is currently
91 unused, and must be set to 0.
92 </p>
93 </div>
94 </div>
95 <div class="sect2" lang="en" xml:lang="en">
96 <div class="titlepage">
97 <div>
98 <div>
99 <h3 class="title"><a id="idp6123848"></a>Errors</h3>
100 </div>
101 </div>
102 </div>
103 <p>
104 The <code class="methodname">Dbc::count()</code> <span>
105
106 <span>
107 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
108 exception, encapsulating one of the following non-zero errors, or return one
109 of the following non-zero errors:
110 </span>
111 </span>
112 </p>
113 <div class="sect3" lang="en" xml:lang="en">
114 <div class="titlepage">
115 <div>
116 <div>
117 <h4 class="title"><a id="idp6125832"></a> <span>DbRepHandleDeadException or</span> DB_REP_HANDLE_DEAD</h4>
118 </div>
119 </div>
120 </div>
121 <p>
122 When a client synchronizes with the master, it is possible for committed
123 transactions to be rolled back. This invalidates all the database and cursor
124 handles opened in the replication environment. Once this occurs, an attempt to use
125 such a handle will
126 <span>
127 throw a <a class="xref" href="dbrephandledead.html" title="DbRepHandleDeadException">DbRepHandleDeadException</a> (if
128 your application is configured to throw exceptions), or
129 </span>
130 return <code class="literal">DB_REP_HANDLE_DEAD</code>.
131 The application will need to discard the handle and open a new one in order to
132 continue processing.
133 </p>
134 </div>
135 <div class="sect3" lang="en" xml:lang="en">
136 <div class="titlepage">
137 <div>
138 <div>
139 <h4 class="title"><a id="idp6127288"></a><span>DbDeadlockException or </span>DB_REP_LOCKOUT</h4>
140 </div>
141 </div>
142 </div>
143 <p>
144 The operation was blocked by client/master synchronization.
145 </p>
146 <p>
147 <a class="xref" href="dbdeadlock.html" title="DbDeadlockException">DbDeadlockException</a> is thrown if
148 your Berkeley DB API is configured to throw exceptions.
149 Otherwise, <code class="literal">DB_REP_LOCKOUT</code> is returned.
150 </p>
151 </div>
152 <div class="sect3" lang="en" xml:lang="en">
153 <div class="titlepage">
154 <div>
155 <div>
156 <h4 class="title"><a id="idp6150576"></a>EINVAL</h4>
157 </div>
158 </div>
159 </div>
160 <p>
161 If the cursor has not been initialized; or if an invalid flag value or parameter was specified.
162 </p>
163 </div>
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="idp6118944"></a>Class</h3>
170 </div>
171 </div>
172 </div>
173 <p>
174 <a class="link" href="dbc.html" title="Chapter 3.  The Dbc Handle">Dbc</a>
175 </p>
176 </div>
177 <div class="sect2" lang="en" xml:lang="en">
178 <div class="titlepage">
179 <div>
180 <div>
181 <h3 class="title"><a id="idp6151096"></a>See Also</h3>
182 </div>
183 </div>
184 </div>
185 <p>
186 <a class="xref" href="dbc.html#dbclist" title="Database Cursors and Related Methods">Database Cursors and Related Methods</a>
187 </p>
188 </div>
189 </div>
190 <div class="navfooter">
191 <hr />
192 <table width="100%" summary="Navigation footer">
193 <tr>
194 <td width="40%" align="left"><a accesskey="p" href="dbccmp.html">Prev</a> </td>
195 <td width="20%" align="center">
196 <a accesskey="u" href="dbc.html">Up</a>
197 </td>
198 <td width="40%" align="right"> <a accesskey="n" href="dbcdel.html">Next</a></td>
199 </tr>
200 <tr>
201 <td width="40%" align="left" valign="top">Dbc::cmp() </td>
202 <td width="20%" align="center">
203 <a accesskey="h" href="index.html">Home</a>
204 </td>
205 <td width="40%" align="right" valign="top"> Dbc::del()</td>
206 </tr>
207 </table>
208 </div>
209 </body>
210 </html>