1<!--$Id: db_set_re_len.so,v 10.40 2004/09/28 15:04:19 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-&gt;set_re_len</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-&gt;set_re_len</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 &lt;db.h&gt;
23<p>
24int
25DB-&gt;set_re_len(DB *db, u_int32_t re_len);
26<p>
27int
28DB-&gt;get_re_len(DB *db, u_int32_t *re_lenp);
29</pre></b>
30<hr size=1 noshade>
31<b>Description: DB-&gt;set_re_len</b>
32<p>For the Queue access method, specify that the records are of length
33<b>re_len</b>.  For the Queue access method, the record length must be
34enough smaller than the database's page size that at least one record
35plus the database page's metadata information can fit on each database
36page.</p>
37<p>For the Recno access method, specify that the records are fixed-length,
38not byte-delimited, and are of length <b>re_len</b>.</p>
39<p>Any records added to the database that are less than <b>re_len</b> bytes
40long are automatically padded (see <a href="/api_c/db_set_re_pad.html">DB-&gt;set_re_pad</a> for more
41information).</p>
42<p>Any attempt to insert records into the database that are greater than
43<b>re_len</b> bytes long will cause the call to fail immediately and
44return an error.</p>
45<p>The DB-&gt;set_re_len method configures a database, not only operations performed
46using the specified <a href="/api_c/db_class.html">DB</a> handle.</p>
47<p>The DB-&gt;set_re_len method may not be called after the <a href="/api_c/db_open.html">DB-&gt;open</a> method is called.
48If the database already exists when
49<a href="/api_c/db_open.html">DB-&gt;open</a> is called, the information specified to DB-&gt;set_re_len will
50be ignored.
51</p>
52<p>The DB-&gt;set_re_len method
53returns a non-zero error value on failure
54and 0 on success.
55</p>
56<b>Parameters</b> <br>
57 <b>re_len</b><ul compact><li>The <b>re_len</b> parameter is the length of a Queue or Recno database
58record, in bytes.</ul>
59<br>
60<br><b>Errors</b>
61<p>The DB-&gt;set_re_len method
62may fail and return one of the following non-zero errors:</p>
63<br>
64<b>EINVAL</b><ul compact><li>If the method was called after <a href="/api_c/db_open.html">DB-&gt;open</a> was called; or if an
65invalid flag value or parameter was specified.</ul>
66<br>
67<hr size=1 noshade>
68<b>Description: DB-&gt;get_re_len</b>
69<p>The DB-&gt;get_re_len method returns the record length.</p>
70<p>The DB-&gt;get_re_len method may be called at any time during the life of the
71application.</p>
72<p>The DB-&gt;get_re_len method
73returns a non-zero error value on failure
74and 0 on success.
75</p>
76<b>Parameters</b> <br>
77 <b>re_lenp</b><ul compact><li>The DB-&gt;get_re_len method returns  the
78record length in <b>re_lenp</b>.</ul>
79<br>
80<hr size=1 noshade>
81<br><b>Class</b>
82<a href="/api_c/db_class.html">DB</a>
83<br><b>See Also</b>
84<a href="/api_c/db_list.html">Databases and Related Methods</a>
85</tt>
86<table width="100%"><tr><td><br></td><td align=right>
87<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>
88</td></tr></table>
89<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
90</body>
91</html>
92