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