| 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.h> |
| 42 | |
| 43 | int |
| 44 | DB->sort_multiple(DB *db, 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 | <span> |
| 64 | method returns a non-zero error value on failure and 0 on success. |
| 65 | </span> |
| 66 | |
| 67 | </span> |
| 68 | </p> |
| 69 | <div class="sect2" lang="en" xml:lang="en"> |
| 70 | <div class="titlepage"> |
| 71 | <div> |
| 72 | <div> |
| 73 | <h3 class="title"><a id="idp50586688"></a>Parameters</h3> |
| 74 | </div> |
| 75 | </div> |
| 76 | </div> |
| 77 | <div class="sect3" lang="en" xml:lang="en"> |
| 78 | <div class="titlepage"> |
| 79 | <div> |
| 80 | <div> |
| 81 | <h4 class="title"><a id="idp50576184"></a>key</h4> |
| 82 | </div> |
| 83 | </div> |
| 84 | </div> |
| 85 | <p> |
| 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> |
| 88 | entries in |
| 89 | <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE">DB_MULTIPLE</a> |
| 90 | or |
| 91 | <a class="link" href="dbcget.html#dbcget_DB_MULTIPLE_KEY">DB_MULTIPLE_KEY</a> |
| 92 | format. |
| 93 | </p> |
| 94 | <p> |
| 95 | The sorted entries will be returned in the |
| 96 | <span class="bold"><strong>key</strong></span> parameter. |
| 97 | </p> |
| 98 | </div> |
| 99 | <div class="sect3" lang="en" xml:lang="en"> |
| 100 | <div class="titlepage"> |
| 101 | <div> |
| 102 | <div> |
| 103 | <h4 class="title"><a id="idp50585888"></a>data</h4> |
| 104 | </div> |
| 105 | </div> |
| 106 | </div> |
| 107 | <p> |
| 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. |
| 114 | </p> |
| 115 | </div> |
| 116 | <div class="sect3" lang="en" xml:lang="en"> |
| 117 | <div class="titlepage"> |
| 118 | <div> |
| 119 | <div> |
| 120 | <h4 class="title"><a id="idp50579488"></a>flags</h4> |
| 121 | </div> |
| 122 | </div> |
| 123 | </div> |
| 124 | <p> |
| 125 | The <span class="bold"><strong>flags</strong></span> parameter must |
| 126 | be set to one of the following values: |
| 127 | </p> |
| 128 | <div class="itemizedlist"> |
| 129 | <ul type="disc"> |
| 130 | <li> |
| 131 | <p><a id="sort_multiple_DB_MULTIPLE"></a> |
| 132 | DB_MULTIPLE |
| 133 | </p> |
| 134 | <p> |
| 135 | Sorts one or two |
| 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. |
| 144 | </p> |
| 145 | </li> |
| 146 | <li> |
| 147 | <p><a id="sort_multiple_DB_MULTIPLE_KEY"></a> |
| 148 | DB_MULTIPLE_KEY |
| 149 | </p> |
| 150 | <p> |
| 151 | Sorts 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>. |
| 154 | </p> |
| 155 | </li> |
| 156 | </ul> |
| 157 | </div> |
| 158 | </div> |
| 159 | </div> |
| 160 | <div class="sect2" lang="en" xml:lang="en"> |
| 161 | <div class="titlepage"> |
| 162 | <div> |
| 163 | <div> |
| 164 | <h3 class="title"><a id="idp50582152"></a>Errors</h3> |
| 165 | </div> |
| 166 | </div> |
| 167 | </div> |
| 168 | <p> |
| 169 | The <code class="methodname">DB->sort_multiple()</code> <span> |
| 170 | <span> |
| 171 | method may fail and return one of the following non-zero errors: |
| 172 | </span> |
| 173 | |
| 174 | </span> |
| 175 | </p> |
| 176 | <div class="sect3" lang="en" xml:lang="en"> |
| 177 | <div class="titlepage"> |
| 178 | <div> |
| 179 | <div> |
| 180 | <h4 class="title"><a id="idp50619624"></a>EACCES</h4> |
| 181 | </div> |
| 182 | </div> |
| 183 | </div> |
| 184 | <p> |
| 185 | An attempt was made to modify a read-only database. |
| 186 | </p> |
| 187 | </div> |
| 188 | <div class="sect3" lang="en" xml:lang="en"> |
| 189 | <div class="titlepage"> |
| 190 | <div> |
| 191 | <div> |
| 192 | <h4 class="title"><a id="idp50622808"></a>EINVAL</h4> |
| 193 | </div> |
| 194 | </div> |
| 195 | </div> |
| 196 | <p> |
| 197 | An invalid flag value or parameter was specified. |
| 198 | </p> |
| 199 | </div> |
| 200 | </div> |
| 201 | <div class="sect2" lang="en" xml:lang="en"> |
| 202 | <div class="titlepage"> |
| 203 | <div> |
| 204 | <div> |
| 205 | <h3 class="title"><a id="idp50619088"></a>Class</h3> |
| 206 | </div> |
| 207 | </div> |
| 208 | </div> |
| 209 | <p> |
| 210 | <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> |
| 211 | </p> |
| 212 | </div> |
| 213 | <div class="sect2" lang="en" xml:lang="en"> |
| 214 | <div class="titlepage"> |
| 215 | <div> |
| 216 | <div> |
| 217 | <h3 class="title"><a id="idp50622056"></a>See Also</h3> |
| 218 | </div> |
| 219 | </div> |
| 220 | </div> |
| 221 | <p> |
| 222 | <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> |
| 223 | </p> |
| 224 | <p> |
| 225 | </p> |
| 226 | <p> |
| 227 | <a class="xref" href="dbt.html#dbtlist" title="DBT and Bulk Operations">DBT and Bulk Operations</a> |
| 228 | </p> |
| 229 | </div> |
| 230 | </div> |
| 231 | <div class="navfooter"> |
| 232 | <hr /> |
| 233 | <table width="100%" summary="Navigation footer"> |
| 234 | <tr> |
| 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> |
| 238 | </td> |
| 239 | <td width="40%" align="right"> <a accesskey="n" href="dbstat.html">Next</a></td> |
| 240 | </tr> |
| 241 | <tr> |
| 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> |
| 245 | </td> |
| 246 | <td width="40%" align="right" valign="top"> DB->stat()</td> |
| 247 | </tr> |
| 248 | </table> |
| 249 | </div> |
| 250 | </body> |
| 251 | </html> |