1<!--$Id: seq_class.so,v 1.12 2004/10/18 19:46:31 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: db_sequence_create</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>db_sequence_create</b> 14</td> 15<td align=right> 16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db.h> 23<p> 24typedef struct __db_sequence DB_SEQUENCE; 25<p> 26int 27db_sequence_create(DB_SEQUENCE **seq, DB *db, u_int32_t flags); 28</pre></b> 29<hr size=1 noshade> 30<b>Description: db_sequence_create</b> 31<p>The DB_SEQUENCE handle is the handle used to manipulate a 32sequence object. A sequence object is stored in a record in a 33database.</p> 34<p>DB_SEQUENCE handles are free-threaded if the <a href="../api_c/env_open.html#DB_THREAD">DB_THREAD</a> 35flag is specified to the <a href="../api_c/seq_open.html">DB_SEQUENCE->open</a> method when the sequence is opened. 36Once the <a href="../api_c/seq_close.html">DB_SEQUENCE->close</a> or <a href="../api_c/seq_remove.html">DB_SEQUENCE->remove</a> methods are called, the 37handle may not be accessed again, regardless of the method's return.</p> 38<p>Each handle opened on a sequence may maintain a separate cache of values 39which are returned to the application using the <a href="../api_c/seq_get.html">DB_SEQUENCE->get</a> method 40either singly or in groups depending on its <b>delta</b> parameter.</p> 41<p>The 42DB_SEQUENCE method creates a 43DB_SEQUENCE object that serves as the handle for a sequence. 44Calling the <a href="../api_c/seq_close.html">DB_SEQUENCE->close</a> or <a href="../api_c/seq_remove.html">DB_SEQUENCE->remove</a> methods will discard the 45handle.</p> 46<p>The db_sequence_create method 47returns a non-zero error value on failure 48and 0 on success. 49</p> 50<b>Parameters</b> <br> 51 <b>seq</b><ul compact><li>The <b>seq</b> parameter references the memory into which the returned 52structure pointer is stored.</ul> 53 <b>db</b><ul compact><li>The <b>db</b> parameter is an open database handle which holds the 54persistent data for the sequence. The database may be of any type, 55but may not have been configured to support duplicate data items.</ul> 56 <b>flags</b><ul compact><li>The <b>flags</b> parameter is currently unused, and must be set to 0.</ul> 57<br> 58<br><b>Errors</b> 59<p>The db_sequence_create method 60may fail and return one of the following non-zero errors:</p> 61<br> 62<b>EINVAL</b><ul compact><li>An 63invalid flag value or parameter was specified.</ul> 64<br> 65<hr size=1 noshade> 66<br><b>Class</b> 67DB_SEQUENCE 68<br><b>See Also</b> 69<a href="../api_c/seq_list.html">Sequences and Related Methods</a> 70</tt> 71<table width="100%"><tr><td><br></td><td align=right> 72<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 73</td></tr></table> 74<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 75</body> 76</html> 77