| 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_sequence_create</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="seq.html" title="Chapter 11. The DB_SEQUENCE Handle" /> |
| 11 | <link rel="prev" href="seq.html" title="Chapter 11. The DB_SEQUENCE Handle" /> |
| 12 | <link rel="next" href="seqclose.html" title="DB_SEQUENCE->close()" /> |
| 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_sequence_create</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="seq.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 11. |
| 26 | The DB_SEQUENCE Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="seqclose.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="seqcreate"></a>db_sequence_create</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int db_sequence_create(DB_SEQUENCE **seq, DB *db, u_int32_t flags); </pre> |
| 44 | <p> |
| 45 | Creates a sequence handle, which can then be opened with |
| 46 | <a class="xref" href="seqopen.html" title="DB_SEQUENCE->open()">DB_SEQUENCE->open()</a>. |
| 47 | </p> |
| 48 | <p> |
| 49 | |
| 50 | <code class="classname">DB_SEQUENCE</code> handles are free-threaded if the |
| 51 | <a class="link" href="seqopen.html#seqopen_DB_THREAD">DB_THREAD</a> |
| 52 | flag is specified to the |
| 53 | <a class="xref" href="seqopen.html" title="DB_SEQUENCE->open()">DB_SEQUENCE->open()</a> |
| 54 | method when the sequence is opened. Once the |
| 55 | <a class="xref" href="seqclose.html" title="DB_SEQUENCE->close()">DB_SEQUENCE->close()</a> or |
| 56 | <a class="xref" href="seqremove.html" title="DB_SEQUENCE->remove()">DB_SEQUENCE->remove()</a> |
| 57 | methods are called, the handle can not be accessed again, regardless |
| 58 | of the method's return. |
| 59 | </p> |
| 60 | <p> |
| 61 | Each handle opened on a sequence may maintain a separate cache of values which are |
| 62 | returned to the application using the <a class="xref" href="seqget.html" title="DB_SEQUENCE->get()">DB_SEQUENCE->get()</a> |
| 63 | method either singly or in groups |
| 64 | depending on its <span class="bold"><strong>delta</strong></span> parameter. |
| 65 | </p> |
| 66 | <p> |
| 67 | Calling the <a class="xref" href="seqclose.html" title="DB_SEQUENCE->close()">DB_SEQUENCE->close()</a> |
| 68 | or <a class="xref" href="seqremove.html" title="DB_SEQUENCE->remove()">DB_SEQUENCE->remove()</a> |
| 69 | methods discards this handle. |
| 70 | </p> |
| 71 | <p> |
| 72 | <code class="function">db_sequence_create()</code> <span> |
| 73 | <span> |
| 74 | method returns a non-zero error value on failure and 0 on success. |
| 75 | </span> |
| 76 | |
| 77 | </span> |
| 78 | </p> |
| 79 | <div class="sect2" lang="en" xml:lang="en"> |
| 80 | <div class="titlepage"> |
| 81 | <div> |
| 82 | <div> |
| 83 | <h3 class="title"><a id="idp54512472"></a>Parameters</h3> |
| 84 | </div> |
| 85 | </div> |
| 86 | </div> |
| 87 | <div class="sect3" lang="en" xml:lang="en"> |
| 88 | <div class="titlepage"> |
| 89 | <div> |
| 90 | <div> |
| 91 | <h4 class="title"><a id="idp54544288"></a>seq</h4> |
| 92 | </div> |
| 93 | </div> |
| 94 | </div> |
| 95 | <p> |
| 96 | The <span class="bold"><strong>seq</strong></span> parameter references the |
| 97 | memory into which the returned structure pointer is stored. |
| 98 | </p> |
| 99 | </div> |
| 100 | <div class="sect3" lang="en" xml:lang="en"> |
| 101 | <div class="titlepage"> |
| 102 | <div> |
| 103 | <div> |
| 104 | <h4 class="title"><a id="idp54559368"></a>db</h4> |
| 105 | </div> |
| 106 | </div> |
| 107 | </div> |
| 108 | <p> |
| 109 | The <span class="bold"><strong>db</strong></span> parameter is an open database |
| 110 | handle which holds the persistent data for the sequence. The database |
| 111 | may be of any type, but must not have been configured to support |
| 112 | duplicate data items. |
| 113 | </p> |
| 114 | </div> |
| 115 | <div class="sect3" lang="en" xml:lang="en"> |
| 116 | <div class="titlepage"> |
| 117 | <div> |
| 118 | <div> |
| 119 | <h4 class="title"><a id="idp54559888"></a>flags</h4> |
| 120 | </div> |
| 121 | </div> |
| 122 | </div> |
| 123 | <p> |
| 124 | The <span class="bold"><strong>flags</strong></span> parameter is |
| 125 | currently unused, and must be set to 0. |
| 126 | </p> |
| 127 | </div> |
| 128 | </div> |
| 129 | <div class="sect2" lang="en" xml:lang="en"> |
| 130 | <div class="titlepage"> |
| 131 | <div> |
| 132 | <div> |
| 133 | <h3 class="title"><a id="idp54565048"></a>Errors</h3> |
| 134 | </div> |
| 135 | </div> |
| 136 | </div> |
| 137 | <p> |
| 138 | The <code class="methodname">db_sequence_create</code> <span> |
| 139 | <span> |
| 140 | method may fail and return one of the following non-zero errors: |
| 141 | </span> |
| 142 | |
| 143 | </span> |
| 144 | </p> |
| 145 | <div class="sect3" lang="en" xml:lang="en"> |
| 146 | <div class="titlepage"> |
| 147 | <div> |
| 148 | <div> |
| 149 | <h4 class="title"><a id="idp54570112"></a>EINVAL</h4> |
| 150 | </div> |
| 151 | </div> |
| 152 | </div> |
| 153 | <p> |
| 154 | An invalid flag value or parameter was specified. |
| 155 | </p> |
| 156 | </div> |
| 157 | </div> |
| 158 | <div class="sect2" lang="en" xml:lang="en"> |
| 159 | <div class="titlepage"> |
| 160 | <div> |
| 161 | <div> |
| 162 | <h3 class="title"><a id="idp54568776"></a>Class</h3> |
| 163 | </div> |
| 164 | </div> |
| 165 | </div> |
| 166 | <p> |
| 167 | <a class="link" href="seq.html" title="Chapter 11. The DB_SEQUENCE Handle">DB_SEQUENCE</a> |
| 168 | </p> |
| 169 | </div> |
| 170 | <div class="sect2" lang="en" xml:lang="en"> |
| 171 | <div class="titlepage"> |
| 172 | <div> |
| 173 | <div> |
| 174 | <h3 class="title"><a id="idp54571448"></a>See Also</h3> |
| 175 | </div> |
| 176 | </div> |
| 177 | </div> |
| 178 | <p> |
| 179 | <a class="xref" href="seq.html#seqlist" title="Sequences and Related Methods">Sequences and Related Methods</a> |
| 180 | </p> |
| 181 | </div> |
| 182 | </div> |
| 183 | <div class="navfooter"> |
| 184 | <hr /> |
| 185 | <table width="100%" summary="Navigation footer"> |
| 186 | <tr> |
| 187 | <td width="40%" align="left"><a accesskey="p" href="seq.html">Prev</a> </td> |
| 188 | <td width="20%" align="center"> |
| 189 | <a accesskey="u" href="seq.html">Up</a> |
| 190 | </td> |
| 191 | <td width="40%" align="right"> <a accesskey="n" href="seqclose.html">Next</a></td> |
| 192 | </tr> |
| 193 | <tr> |
| 194 | <td width="40%" align="left" valign="top">Chapter 11. |
| 195 | The DB_SEQUENCE Handle |
| 196 | </td> |
| 197 | <td width="20%" align="center"> |
| 198 | <a accesskey="h" href="index.html">Home</a> |
| 199 | </td> |
| 200 | <td width="40%" align="right" valign="top"> DB_SEQUENCE->close()</td> |
| 201 | </tr> |
| 202 | </table> |
| 203 | </div> |
| 204 | </body> |
| 205 | </html> |