| 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>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()" /> |
| 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">Db::sort_multiple()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 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. |
| 26 | The Db Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="dbstat.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="dbsort_multiple"></a>Db::sort_multiple()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db_cxx.h> |
| 42 | |
| 43 | int |
| 44 | Db::sort_multiple(Dbt *key, Dbt *data, u_int32_t flags);</pre> |
| 45 | <p> |
| 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. |
| 49 | </p> |
| 50 | <p> |
| 51 | If specified the application specific btree comparison and |
| 52 | duplicate comparison functions will be used if they are |
| 53 | configured. |
| 54 | </p> |
| 55 | <p> |
| 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>. |
| 60 | </p> |
| 61 | <p> |
| 62 | The <code class="methodname">Db::sort_multiple()</code> <span> |
| 63 | |
| 64 | <span> |
| 65 | method either returns a non-zero error value or throws an |
| 66 | exception that encapsulates a non-zero error value on |
| 67 | failure, and returns 0 on success. |
| 68 | </span> |
| 69 | </span> |
| 70 | </p> |
| 71 | <div class="sect2" lang="en" xml:lang="en"> |
| 72 | <div class="titlepage"> |
| 73 | <div> |
| 74 | <div> |
| 75 | <h3 class="title"><a id="idp5869984"></a>Parameters</h3> |
| 76 | </div> |
| 77 | </div> |
| 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="idp5870584"></a>key</h4> |
| 84 | </div> |
| 85 | </div> |
| 86 | </div> |
| 87 | <p> |
| 88 | The <span class="bold"><strong>key</strong></span> parameter must |
| 89 | contain a set of <a class="link" href="dbt.html" title="Chapter 4. The Dbt Handle">Dbt</a> |
| 90 | entries in |
| 91 | <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE">DB_MULTIPLE</a> |
| 92 | or |
| 93 | <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE_KEY">DB_MULTIPLE_KEY</a> |
| 94 | format. |
| 95 | </p> |
| 96 | <p> |
| 97 | The sorted entries will be returned in the |
| 98 | <span class="bold"><strong>key</strong></span> parameter. |
| 99 | </p> |
| 100 | </div> |
| 101 | <div class="sect3" lang="en" xml:lang="en"> |
| 102 | <div class="titlepage"> |
| 103 | <div> |
| 104 | <div> |
| 105 | <h4 class="title"><a id="idp5849984"></a>data</h4> |
| 106 | </div> |
| 107 | </div> |
| 108 | </div> |
| 109 | <p> |
| 110 | If non-NULL, the <span class="bold"><strong>data</strong></span> |
| 111 | parameter must contain a set of |
| 112 | <a class="link" href="dbt.html" title="Chapter 4. The Dbt Handle">Dbt</a>s entries in |
| 113 | <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE">DB_MULTIPLE</a> |
| 114 | format. Each entry must correspond to an entry in the |
| 115 | <span class="bold"><strong>key</strong></span> parameter. |
| 116 | </p> |
| 117 | </div> |
| 118 | <div class="sect3" lang="en" xml:lang="en"> |
| 119 | <div class="titlepage"> |
| 120 | <div> |
| 121 | <div> |
| 122 | <h4 class="title"><a id="idp5869656"></a>flags</h4> |
| 123 | </div> |
| 124 | </div> |
| 125 | </div> |
| 126 | <p> |
| 127 | The <span class="bold"><strong>flags</strong></span> parameter must |
| 128 | be set to one of the following values: |
| 129 | </p> |
| 130 | <div class="itemizedlist"> |
| 131 | <ul type="disc"> |
| 132 | <li> |
| 133 | <p><a id="sort_multiple_DB_MULTIPLE"></a> |
| 134 | DB_MULTIPLE |
| 135 | </p> |
| 136 | <p> |
| 137 | Sorts one or two |
| 138 | <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE">DB_MULTIPLE</a> |
| 139 | format <a class="link" href="dbt.html" title="Chapter 4. The Dbt Handle">Dbt</a>s. |
| 140 | Assumes that <span class="bold"><strong>key</strong></span> |
| 141 | and <span class="bold"><strong>data</strong></span> specify |
| 142 | pairs of key and data items to sort together. If |
| 143 | the <span class="bold"><strong>data</strong></span> parameter |
| 144 | is NULL the API will sort the key arrays according |
| 145 | to the btree comparison function. |
| 146 | </p> |
| 147 | </li> |
| 148 | <li> |
| 149 | <p><a id="sort_multiple_DB_MULTIPLE_KEY"></a> |
| 150 | DB_MULTIPLE_KEY |
| 151 | </p> |
| 152 | <p> |
| 153 | Sorts a |
| 154 | <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE_KEY">DB_MULTIPLE_KEY</a> |
| 155 | format <a class="link" href="dbt.html" title="Chapter 4. The Dbt Handle">Dbt</a>. |
| 156 | </p> |
| 157 | </li> |
| 158 | </ul> |
| 159 | </div> |
| 160 | </div> |
| 161 | </div> |
| 162 | <div class="sect2" lang="en" xml:lang="en"> |
| 163 | <div class="titlepage"> |
| 164 | <div> |
| 165 | <div> |
| 166 | <h3 class="title"><a id="idp5876784"></a>Errors</h3> |
| 167 | </div> |
| 168 | </div> |
| 169 | </div> |
| 170 | <p> |
| 171 | The <code class="methodname">Db::sort_multiple()</code> <span> |
| 172 | |
| 173 | <span> |
| 174 | method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> |
| 175 | exception, encapsulating one of the following non-zero errors, or return one |
| 176 | of the following non-zero errors: |
| 177 | </span> |
| 178 | </span> |
| 179 | </p> |
| 180 | <div class="sect3" lang="en" xml:lang="en"> |
| 181 | <div class="titlepage"> |
| 182 | <div> |
| 183 | <div> |
| 184 | <h4 class="title"><a id="idp5889992"></a>EACCES</h4> |
| 185 | </div> |
| 186 | </div> |
| 187 | </div> |
| 188 | <p> |
| 189 | An attempt was made to modify a read-only database. |
| 190 | </p> |
| 191 | </div> |
| 192 | <div class="sect3" lang="en" xml:lang="en"> |
| 193 | <div class="titlepage"> |
| 194 | <div> |
| 195 | <div> |
| 196 | <h4 class="title"><a id="idp5888696"></a>EINVAL</h4> |
| 197 | </div> |
| 198 | </div> |
| 199 | </div> |
| 200 | <p> |
| 201 | An invalid flag value or parameter was specified. |
| 202 | </p> |
| 203 | </div> |
| 204 | </div> |
| 205 | <div class="sect2" lang="en" xml:lang="en"> |
| 206 | <div class="titlepage"> |
| 207 | <div> |
| 208 | <div> |
| 209 | <h3 class="title"><a id="idp5887400"></a>Class</h3> |
| 210 | </div> |
| 211 | </div> |
| 212 | </div> |
| 213 | <p> |
| 214 | <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> |
| 215 | </p> |
| 216 | </div> |
| 217 | <div class="sect2" lang="en" xml:lang="en"> |
| 218 | <div class="titlepage"> |
| 219 | <div> |
| 220 | <div> |
| 221 | <h3 class="title"><a id="idp5883784"></a>See Also</h3> |
| 222 | </div> |
| 223 | </div> |
| 224 | </div> |
| 225 | <p> |
| 226 | <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> |
| 227 | </p> |
| 228 | <p> |
| 229 | </p> |
| 230 | <p> |
| 231 | <a class="xref" href="dbt.html#dbtlist" title="DBT and Bulk Operations">DBT and Bulk Operations</a> |
| 232 | </p> |
| 233 | </div> |
| 234 | </div> |
| 235 | <div class="navfooter"> |
| 236 | <hr /> |
| 237 | <table width="100%" summary="Navigation footer"> |
| 238 | <tr> |
| 239 | <td width="40%" align="left"><a accesskey="p" href="dbset_re_source.html">Prev</a> </td> |
| 240 | <td width="20%" align="center"> |
| 241 | <a accesskey="u" href="db.html">Up</a> |
| 242 | </td> |
| 243 | <td width="40%" align="right"> <a accesskey="n" href="dbstat.html">Next</a></td> |
| 244 | </tr> |
| 245 | <tr> |
| 246 | <td width="40%" align="left" valign="top">Db::set_re_source() </td> |
| 247 | <td width="20%" align="center"> |
| 248 | <a accesskey="h" href="index.html">Home</a> |
| 249 | </td> |
| 250 | <td width="40%" align="right" valign="top"> Db::stat()</td> |
| 251 | </tr> |
| 252 | </table> |
| 253 | </div> |
| 254 | </body> |
| 255 | </html> |