<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [pybsddb] BDB Indexing and Joined Cursor issue</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000080" SIZE=2 FACE="Arial">Since, I am using indexes (secondary databases), I need to make sure, if there are records in each (secondary database) cursor. So as per your suggestion, I started with using count(), later changed to get_current_size().</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#000080" SIZE=2 FACE="Arial">Following the function, I am using to find join()’ed cursor of all secondary database, based on filter queries for each secondary database.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">def</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B> <FONT COLOR="#000000" SIZE=2 FACE="Courier New">search</FONT></B></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">(</FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I><FONT COLOR="#000000" SIZE=2 FACE="Courier New">self</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">, pattern):</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> queries = splitKey(pattern)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">print</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I> <FONT COLOR="#00AA00" SIZE=2 FACE="Courier New">"Queries: "</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">, queries</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">print</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I> <FONT COLOR="#00AA00" SIZE=2 FACE="Courier New">"Secondary database count: "</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">, len(</FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I><FONT COLOR="#000000" SIZE=2 FACE="Courier New">self</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">.dbs)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">try</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">if</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> len(</FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I><FONT COLOR="#000000" SIZE=2 FACE="Courier New">self</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">.dbs)></FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#800000" SIZE=2 FACE="Courier New">0</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> curs = []</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> i=</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#800000" SIZE=2 FACE="Courier New">0</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#800000" SIZE=2 FACE="Courier New"> # Iterate over all the secondary index databases to get individual</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#800000" SIZE=2 FACE="Courier New"> # cursors and join to get final filter from primary database.</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> # self.dbs is array of all secondary database handles</FONT></B></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">for</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> dbsi</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">in</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I> <FONT COLOR="#000000" SIZE=2 FACE="Courier New">self</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">.dbs:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">try</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">if</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> i>(len(queries)-</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#800000" SIZE=2 FACE="Courier New">1</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">):</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">break</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> cur = dbsi.cursor()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">if</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> queries[i].find(</FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I><FONT COLOR="#00AA00" SIZE=2 FACE="Courier New">"x"</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">)<</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#800000" SIZE=2 FACE="Courier New">0</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> cur.pget(key=queries[i], flags=DB_SET_RANGE)</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B></B></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">try</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">if</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> cur.get_current_size()></FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#800000" SIZE=2 FACE="Courier New">0</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New">: ## previously ## if cur.count()>0:</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B></B></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> curs.append(cur)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">else</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> cur.close()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">except</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> Exception, e:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">print</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I> <FONT COLOR="#00AA00" SIZE=2 FACE="Courier New">"Exception in get current size: "</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">, e</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> traceback.print_exc(file=sys.stdout)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> cur.close()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> i+=</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#800000" SIZE=2 FACE="Courier New">1</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">except</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> Exception, e:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">print</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I> <FONT COLOR="#00AA00" SIZE=2 FACE="Courier New">"Exception in search, case 0: "</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">, e</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> traceback.print_exc(file=sys.stdout)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">raise</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> NextDigital.DBEOFException()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT SIZE=2 FACE="Courier New"> # checking, if enough secondary database handle available to be joined!</FONT></B></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">if</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> len(curs)<=</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#800000" SIZE=2 FACE="Courier New">0</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B></B></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">raise</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> NextDigital.DBEOFException()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">try</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> # this is where, I am creating my joined cursor, on which I only invoke, get(0) operation.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> # self.db is primary database handle</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B></B></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> joinedCursor =</FONT></B></SPAN><SPAN LANG="en-au"><B><I></I></B></SPAN><SPAN LANG="en-au"><B><I> <FONT COLOR="#000000" SIZE=2 FACE="Courier New">self</FONT></I></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B><FONT COLOR="#000000" SIZE=2 FACE="Courier New">.db.join(curs)</FONT></B></SPAN><SPAN LANG="en-au"><B></B></SPAN><SPAN LANG="en-au"><B></B></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">if</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">not</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> joinedCursor:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">raise</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> NextDigital.DBEOFException()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">return</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> (curs, joinedCursor)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">except</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> Exception, e:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">raise</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> NextDigital.DBEOFException()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">else</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> cur =</FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I> <FONT COLOR="#000000" SIZE=2 FACE="Courier New">self</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">.db.cursor()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> cur.set_range(pattern)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">return</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> ([], cur)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">except</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> Exception, e:</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">print</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"></FONT></SPAN><SPAN LANG="en-au"><I></I></SPAN><SPAN LANG="en-au"><I> <FONT COLOR="#00AA00" SIZE=2 FACE="Courier New">"Exception in search, case last: "</FONT></I></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New">, e</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#C0C0C0" SIZE=2 FACE="Courier New">#traceback.print_exc(file=sys.stdout)</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> </FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"> <FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">raise</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"><FONT COLOR="#000000" SIZE=2 FACE="Courier New"> NextDigital.DBEOFException()</FONT></SPAN><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"></SPAN><SPAN LANG="en-au"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#000080" SIZE=2 FACE="Arial">Ideally, pget shall set the pointer to some found record on secondary cursor. But in my particular query, no records are found, that’s where I need to handle this error before calling join().</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#000080" SIZE=2 FACE="Arial">But, if we are getting stuck to the same vicious circle of finding non-empty cursor, how could I determine, whether to join() or not join()? As, join() is getting deadlock or core dump if we try to join empty cursors.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#000080" SIZE=2 FACE="Arial">Please suggest further.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#000080" SIZE=2 FACE="Arial">Regards,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-au"><FONT COLOR="#000080" SIZE=2 FACE="Arial">Surya</FONT></SPAN></P>
</BODY>
</HTML>