<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Sorry about that. Should have been more verbose. My bad.<br><br>############<br>This is what I did initially<br><br>from bsddb3 import db<br><br>db1 = db.DB()<br><br>db1.open("Temp.db", None, db.DB_BTREE, db.DB_CREATE)<br><br>db1.put('abc%200105%Key1','jp1p')<br>db1.put('abc%200105%Key2','jp2p')<br><br>db1.close()<br><br>Worked great<br>############<br>Then, was trying to add more keys to it in the bulk format. And was trying to think that a tuple of keys and tuple of values in one put will be the way to get the bulk data loaded. That was the code pasted earlier. This is command i used from the last post<br><br>db1.put(keys, val, None, DB_MULTIPLE)<br><br>Then you get this error message <br>NameError: name 'DB_MULTIPLE' is not defined<br><br>So my thought was may be this feature is still not implemented. Just want to see what members here
thought.<br><br>Appreciate all your help and discussions.<br>Thanks<br><br><br>--- On <b>Sat, 3/27/10, hasanyasin <i><hasanyasin@cubicpen.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: hasanyasin <hasanyasin@cubicpen.com><br>Subject: Re: [pybsddb] Bulk Data load into a DB<br>To: "Python bindings for Oracle Berkeley DB" <pybsddb@jcea.es><br>Date: Saturday, March 27, 2010, 1:57 AM<br><br><div id="yiv910964059">
Hi,<br>
I am not sure if that feature is interfaced in pybsddb yet; but before
that, I will ask you some other things: When you are opening a db, it
would be better to provide dbtype and flags so we can see what the
dbtype and flags of it are. Also, if that db did not exist already, it
won't open without DB_CREATE flag. The name "DB_MULTIPLE" is not
importad to global scope so you can access it via "db" module name as
db.DB_MULTIPLE.<br>
<br>
In addition to these, saying "this didn't work" does not give any clues
to us. Please provide the exceptions throwed.<br>
<br>
Have a good day,<br>
hasanyasin<br>
<br>
On 27.03.2010 00:38, Joepaul Puthenangadi wrote:
<blockquote type="cite">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top"><span style="font-family: arial,helvetica,sans-serif;">Hi
there,</span><br style="font-family: arial,helvetica,sans-serif;">
<br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">Was
reading through the documentation and found something on the oracle
website about the possibility of loading bulk key and values into a
hash or btree db using the flag = </span><code style="font-family: arial,helvetica,sans-serif;" class="literal">DB_MULTIPLE.
Not trying to be picky or anything just wanted to know whether that is
something yet to be implemented to </code><span style="font-family: arial,helvetica,sans-serif;">bsddb3 module.?</span><br style="font-family: arial,helvetica,sans-serif;">
<br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">Again
thanks a lot for the wonderful module.</span><br style="font-family: arial,helvetica,sans-serif;">
<br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">Thanks
again</span><br>
<br>
#Sample code<br>
<code class="literal"><br>
</code>from bsddb3 import db<br>
<br>
db1 = db.DB()<br>
db1.open("Temp.db")<br>
<br>
keys = ('key1','key2','key3')<br>
val = ('10','15','20')<br>
<br>
db1.put(keys, val, None, DB_MULTIPLE)<br>
<br>
db1.close()<br>
<br>
###<br>
This did not work. Any thoughts.?<br>
<br>
Thanks<br>
</td>
</tr>
</tbody>
</table>
<br>
<pre><fieldset class="mimeAttachmentHeader"></fieldset><br>_______________________________________________<br>pybsddb mailing list<br><a rel="nofollow" class="moz-txt-link-abbreviated" ymailto="mailto:pybsddb@jcea.es" target="_blank" href="/mc/compose?to=pybsddb@jcea.es">pybsddb@jcea.es</a><br><a rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="https://mailman.jcea.es:28443/listinfo/pybsddb">https://mailman.jcea.es:28443/listinfo/pybsddb</a><br><a rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="http://www.jcea.es/programacion/pybsddb.htm">http://www.jcea.es/programacion/pybsddb.htm</a></pre>
</blockquote>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>pybsddb mailing list<br><a ymailto="mailto:pybsddb@jcea.es" href="/mc/compose?to=pybsddb@jcea.es">pybsddb@jcea.es</a><br><a href="https://mailman.jcea.es:28443/listinfo/pybsddb" target="_blank">https://mailman.jcea.es:28443/listinfo/pybsddb</a><br><a href="http://www.jcea.es/programacion/pybsddb.htm" target="_blank">http://www.jcea.es/programacion/pybsddb.htm</a></div></blockquote></td></tr></table><br>