1<!--$Id: dbc_dup.so,v 10.34 2007/10/24 16:06:07 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: DBcursor->dup</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>DBcursor->dup</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> 24int 25DBcursor->dup(DBC *DBcursor, DBC **cursorp, u_int32_t flags); 26</pre></b> 27<hr size=1 noshade> 28<b>Description: DBcursor->dup</b> 29<p>The DBcursor->dup method creates a new cursor that uses the same transaction 30and locker ID as the original cursor. This is useful when an application 31is using locking and requires two or more cursors in the same thread of 32control.</p> 33<p>The DBcursor->dup method 34returns a non-zero error value on failure 35and 0 on success. 36</p> 37<b>Parameters</b> <br> 38 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one 39or more of the following values: 40<br> 41<b><a name="DB_POSITION">DB_POSITION</a></b><ul compact><li>The newly created cursor is initialized to refer to the same position 42in the database as the original cursor (if any) and hold the same locks 43(if any). If the DB_POSITION flag is not specified, or the 44original cursor does not hold a database position and locks, the created 45cursor is uninitialized and will behave like a cursor newly created 46using <a href="../api_c/db_cursor.html">DB->cursor</a>.</ul> 47<br></ul> 48<br> 49<br><b>Errors</b> 50<p>The DBcursor->dup method 51may fail and return one of the following non-zero errors:</p> 52<br> 53<b>DB_REP_HANDLE_DEAD</b><ul compact><li>The database handle has been invalidated because a replication election 54unrolled a committed transaction.</ul> 55<br> 56<br> 57<b>DB_REP_LOCKOUT</b><ul compact><li>The operation was blocked by client/master synchronization.</ul> 58<br> 59<br> 60<b>EINVAL</b><ul compact><li>An 61invalid flag value or parameter was specified.</ul> 62<br> 63<hr size=1 noshade> 64<br><b>Class</b> 65<a href="../api_c/dbc_class.html">DBC</a> 66<br><b>See Also</b> 67<a href="../api_c/dbc_list.html">Database Cursors and Related Methods</a> 68</tt> 69<table width="100%"><tr><td><br></td><td align=right> 70<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> 71</td></tr></table> 72<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 73</body> 74</html> 75