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">
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DB->sort_multiple()</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="db.html" title="Chapter 2. The DB Handle" />
11 <link rel="prev" href="dbset_re_source.html" title="DB->set_re_source()" />
12 <link rel="next" href="dbstat.html" title="DB->stat()" />
15 <div xmlns="" class="navheader">
17 <p>Library Version 11.2.5.3</p>
19 <table width="100%" summary="Navigation header">
21 <th colspan="3" align="center">DB->sort_multiple()</th>
24 <td width="20%" align="left"><a accesskey="p" href="dbset_re_source.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 2.
28 <td width="20%" align="right"> <a accesskey="n" href="dbstat.html">Next</a></td>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
37 <h2 class="title" style="clear: both"><a id="dbsort_multiple"></a>DB->sort_multiple()</h2>
41 <pre class="programlisting">#include <db.h>
44 DB->sort_multiple(DB *db, DBT *key, DBT *data, u_int32_t flags); </pre>
46 The <code class="methodname">DB->sort_multiple()</code> method is used
47 to sort a set of <a class="link" href="dbt.html" title="Chapter 4. The DBT Handle">DBT</a>s into
48 database insert order.
51 If specified the application specific btree comparison and
52 duplicate comparison functions will be used if they are
56 The key and data parameters must contain pairs of items. That is
57 the n-th entry in <span class="bold"><strong>key</strong></span> must
58 correspond to the n-th entry in
59 <span class="bold"><strong>data</strong></span>.
62 The <code class="methodname">DB->sort_multiple()</code> <span>
64 method returns a non-zero error value on failure and 0 on success.
69 <div class="sect2" lang="en" xml:lang="en">
70 <div class="titlepage">
73 <h3 class="title"><a id="idp58589752"></a>Parameters</h3>
77 <div class="sect3" lang="en" xml:lang="en">
78 <div class="titlepage">
81 <h4 class="title"><a id="idp58562376"></a>key</h4>
86 The <span class="bold"><strong>key</strong></span> parameter must
87 contain a set of <a class="link" href="dbt.html" title="Chapter 4. The DBT Handle">DBT</a>
89 <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE">DB_MULTIPLE</a>
91 <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE_KEY">DB_MULTIPLE_KEY</a>
95 The sorted entries will be returned in the
96 <span class="bold"><strong>key</strong></span> parameter.
99 <div class="sect3" lang="en" xml:lang="en">
100 <div class="titlepage">
103 <h4 class="title"><a id="idp58586008"></a>data</h4>
108 If non-NULL, the <span class="bold"><strong>data</strong></span>
109 parameter must contain a set of
110 <a class="link" href="dbt.html" title="Chapter 4. The DBT Handle">DBT</a>s entries in
111 <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE">DB_MULTIPLE</a>
112 format. Each entry must correspond to an entry in the
113 <span class="bold"><strong>key</strong></span> parameter.
116 <div class="sect3" lang="en" xml:lang="en">
117 <div class="titlepage">
120 <h4 class="title"><a id="idp58584032"></a>flags</h4>
125 The <span class="bold"><strong>flags</strong></span> parameter must
126 be set to one of the following values:
128 <div class="itemizedlist">
131 <p><a id="sort_multiple_DB_MULTIPLE"></a>
136 <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE">DB_MULTIPLE</a>
137 format <a class="link" href="dbt.html" title="Chapter 4. The DBT Handle">DBT</a>s.
138 Assumes that <span class="bold"><strong>key</strong></span>
139 and <span class="bold"><strong>data</strong></span> specify
140 pairs of key and data items to sort together. If
141 the <span class="bold"><strong>data</strong></span> parameter
142 is NULL the API will sort the key arrays according
143 to the btree comparison function.
147 <p><a id="sort_multiple_DB_MULTIPLE_KEY"></a>
152 <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE_KEY">DB_MULTIPLE_KEY</a>
153 format <a class="link" href="dbt.html" title="Chapter 4. The DBT Handle">DBT</a>.
160 <div class="sect2" lang="en" xml:lang="en">
161 <div class="titlepage">
164 <h3 class="title"><a id="idp58574912"></a>Errors</h3>
169 The <code class="methodname">DB->sort_multiple()</code> <span>
171 method may fail and return one of the following non-zero errors:
176 <div class="sect3" lang="en" xml:lang="en">
177 <div class="titlepage">
180 <h4 class="title"><a id="idp58606656"></a>EACCES</h4>
185 An attempt was made to modify a read-only database.
188 <div class="sect3" lang="en" xml:lang="en">
189 <div class="titlepage">
192 <h4 class="title"><a id="idp58607064"></a>EINVAL</h4>
197 An invalid flag value or parameter was specified.
201 <div class="sect2" lang="en" xml:lang="en">
202 <div class="titlepage">
205 <h3 class="title"><a id="idp58606272"></a>Class</h3>
210 <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a>
213 <div class="sect2" lang="en" xml:lang="en">
214 <div class="titlepage">
217 <h3 class="title"><a id="idp58608808"></a>See Also</h3>
222 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a>
227 <a class="xref" href="dbt.html#dbtlist" title="DBT and Bulk Operations">DBT and Bulk Operations</a>
231 <div class="navfooter">
233 <table width="100%" summary="Navigation footer">
235 <td width="40%" align="left"><a accesskey="p" href="dbset_re_source.html">Prev</a> </td>
236 <td width="20%" align="center">
237 <a accesskey="u" href="db.html">Up</a>
239 <td width="40%" align="right"> <a accesskey="n" href="dbstat.html">Next</a></td>
242 <td width="40%" align="left" valign="top">DB->set_re_source() </td>
243 <td width="20%" align="center">
244 <a accesskey="h" href="index.html">Home</a>
246 <td width="40%" align="right" valign="top"> DB->stat()</td>