Can I configure the BTREE compare function at search time?

Hi, all,
I was implementing the 'order by' feature on top of BDB. The problem I met is the "reverse order", that means 'order by xxx desc'.
BDB provides cursor->get API that is used to do search, with flags of 'DB_SET_RANGE', 'DB_GET_BOTH_RANGE'. This is perfect when do 'order by xxx asc' search.
But when I do reverse search, it is complicated, because such as 'DB_SET_RANGE', they find the record that is equal or large than, not equal or less than, this situation becomes even more complicated when the records is duplicated(I need move the cursor forward and back, back and forword). My question is, is there a way to specify the Btree compare function at search time? Now I can only find a way to specify the compare function when the db is created. If there are options that can reverse the compare function at search time, also things done.
Thanks very much!
Regards,
Steve
Edited by: Steve Chu on Jun 4, 2009 4:42 PM

Hi,
It is not possible to change the btree comparison function after the database has been created. It needs to return consistent results at all times, or the internal btree structure will become corrupt.
I don't really understand the issue you are facing. Can't you do a DBC->get(DB_SET_RANGE) call, and then walk the cursor backwards? That is if the position returned from the DBC->get(DB_SET_RANGE) is not equal to the requested key, call DBC->get(DB_PREV) before iterating any further?
It is possible to control the behavior of the previous/next operations on cursors in relation to duplicate sets by using the correct flags. See the documentation for [DB_PREV_NODUP|http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/dbc_get.html#DB_PREV_NODUP]. You can see the other related flags documented on the same page.
Regards,
Alex Gorrod, Oracle Berkeley DB

Similar Messages

  • Can I use the wireless backup functionality of a time capsule with a PC?

    Can I use the wireless backup functionality of a time capsule with a PC?

    Yes, take a look at this link, http://techsupport.foreverwarm.com/time-capsule-windows

  • How can I debug the Call Library Function at run-time

    I've written a VI using the CLF to call a DLL which was compiled off-site by another engineer using MSVC. Even though the VI runs without flagging any errors, the VI is not doing what I expect. Is there any way of finding out if the DLL is been called correctly? The first function that is called doesn't return any value, but I think that it should. Does this mean that the DLL is not being called correctly? Note also that the DLL works fine with a JAVA GUI.

    Make sure that you are specifying the proper function prototype in the call library function. If you are slightly off the call will not work properly. Ask the offsite engineer to provide you with this data. Another tip is to build the dll with the option to show front panel when called. You can actually popup the dll like you would a subvi. If you design it with test indicators showing on the front panel that is a great way to determine if it is working. Hope this helps.
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor

  • How can i do the upload file function using tomcat library??

    how can i do the upload file function using tomcat library??

    Did you read the document for the library?
    If you can't figure it out, why don't you ask the people who provide the library?
    This has nothing to do with JavaMail.

  • I just installed Readdledocs on my ipod, and now when I launch the app, I get a screen which says "downloading message" and the app freezes and won't do anything else.  How can I get the app to function again?

    I just installed Readdledocs on my ipod, and now when I launch the app, I get a screen which says "downloading message" and the app freezes and won't do anything else.  How can I get the app to function again?
    This happened after I tried to get Readdledocs to open an epub file which I created in Calibre.

    This is a followup to my own posting above.
    Thanks to Dave Sawyer for posting information about re-downloading an app which has been deleted.  I deleted the app from iTunes.  Then, when I synched, iTunes asked me if I wanted the items on my ipod touch copied back into iTunes.  I said yes and then synched.
    Readdledocs is now working again.  It is no longer frozen.  However, I have learned my lesson.  I will download only pdf's from now on.  I don't think it works so well with epub files.  The text reflow feature of Readdledocs is exactly what I need to use for my work documents on my ipod touch.

  • Can we configure the no of days an instance stay in engine db/workspace

    Oracle BPM 10.3 MP2 WL Version
    Can we configure the no of days , instance needs to stay in engine db after going to end.
    In process admin, under alengine - services tab - we have Disposer Latency and Instance Expiration properties.
    If Disposer Latency is set to 1 day, Instance Expiration is set to 15 days, does it mean that instance would stay in engine db / workspace for 15 days after reaching end of the process?
    If I want the instance level data to stay in engine db / workspace for 60 - 90 days, Can I achieve it by setting Instance Expiration to 60 / 90 days?

    The disposer latency specifies how often the queue of instances is looked at for disposal. If it is set to 2 days then the queue is evaluated every two days. If the instance expiration is set to 15 days then this is the minimum amount of time that an instance can sit in the End activity. Every 2 days the disposer looks at the instances that have sat in the End activity for at least 15 days. In theory, an instance can sit in the End activity for 16 days 23 hours and 59 minutes (15 days + almost 2 days).
    Dan

  • Can we configure the dynamic IP address in receiver JDBC channel

    Hello,
    Can we configure the dynamic IP address in receiver JDBC communication channel at runtime.
    Thanks,
    Soorya.

    No, that is not possible.
    The simplest solution would be to define a service and communication channel for each server and then use the receiver determination to determine which service to send to.
    The only other way would be to use a receiver java proxy where you would have to code in the JDBC request yourself.
    Regards,
    Yaghya

  • HT2216 I am on OSX 10.7.5 and recently had to reinstall it due to 'mail' not working correctly.  That problem was resolved but now my I can't use the 'right click' function on the apple usb mouse.  Any clues?

    I am on OSX 10.7.5 and recently had to reinstall it due to 'mail' not working correctly.  That problem was resolved but now my I can't use the 'right click' function on the apple usb mouse.  I only have a previous version re-install disc as I bought the latest OSX off the app store.  Any help gratefully received?

    Hmmm, no, no drivers needed, now it sounds like a bad install... unless you might have some old Mouse software installed???
    If 10.7.0 or later...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.
    If that doesn't help Reinstall the OS.

  • I can't use the right-click function on websites (i.e. Yahoo! Mail) because Firefox's context menu is in the way. How can I fix this?

    I can't use the right-click function on websites (i.e. Yahoo! Mail) because Firefox's context menu is in the way.

    Tools > Options > Content : JavaScript > Advanced > Allow Scripts to: [X] "Disable or replace context menus"

  • Where can i configure the jsp's encoding content?

    i write application in chinese soft enviorment ,every time the jsp is saved,the encoding ="gb2312" was deleted ,so i have to rewrite again,it's not convenient!
    how could i handle above problem?can i configure the encoding content for all pages?thanks.

    Hello,
    Unfortunately the EA version has several issues w/encoding. We believe we've fixed them up in our next release, but unfortunately with EA, there are a lot of limitiations.
    Apologies for the trouble.
    Val

  • How can we configure the width of the table in SAP DB

    Hello sirs,
    How can we configure the width of the table in SAP DB? (<b>i.e to specify the total width of the sum of all columns</b>). I need to change the default value of table width for adding fields with biggger sizes...
    With best regards,
    Sudheesh....

    Hi,
      The restrictions for using SAPDB are available at the following link http://dev.mysql.com/doc/maxdb/en/f6/069940ccd42a54e10000000a1550b0/content.htm
      The 'internal length of the table' is 8088 bytes, which intern maps to the column width attribute.
    Can we change the column width?
    The answer is 'NO'.
    check the general Column width error (-1115) at link below where it is specified that the column width can be altered http://dev.mysql.com/doc/maxdb/en/bb/57f18204fd11d2a96c00a0c9449261/content.htm
    Refer link below for more details on the width of each column (based on the datatype associated with the column). http://orgs.man.ac.uk/documentation/mysql/manual_Column_types.html
    So we will have to judiciously look into the boundary values for each column and set the right length because if the column is char(200) and it holds a null value then length allocated is 200 bytes.
    The restriction cannot be broken.
    Regards,
    S.Divakar

  • Where can i find the 2D deconv function?

    It maybe a quick question, where can i find the 2D deconv function?
    I can not find it and search with  no resoult
    ,Can anyone help me ? theanks!

    Hi
    My guess is you are refering to a deconvolution fuction like the one in Matlab called deconv. To my knowledge Labview only provides the deconvolution function to work with point by point input or vector input. Thus if you want to operate on 2D input I would recon that you could do something in a for loop.
    Sletten

  • I have a new Macbook pro and can't recall the password I used with my Time capsule - How can I (ideally) retrieve or possibly change the time capsule password?

    I have a new Macbook pro and can't recall the password I used with my Time capsule - How can I (ideally) retrieve or possibly change the time capsule password?

    Remember security on a TC is an illusion.
    Simply press the reset button for 1-2 sec.. you must not do too long .. it will then hard reset.. but soft reset will revert all passwords to default for 5min. ie TC password is now public.
    Remember this the next time because anybody at all can change your passwords.
    Once into the TC you can then open the view passwords if you wanted any weaker security. Click and open the TC.. and click on edit.. then go to the top menu..
    Voila .. all your passwords in plain sight to any Tom Dick and Fred.

  • How can I calculate the waveform integral in a defined time interval?

    Hi:
    I need your help. How can I calculate the waveform integral in a defined time interval? For example: from "0" to "2pi"?!
    Thanks.

    Hello Clecio,
    You might want to try the Integral x(t) VI.  The documentation for this VI notes:
    Performs the discrete integration of the sampled signal X. Integral x(t) calculates a definite integral. The value of the output array at any value x is the area under the curve of the input array between 0 and x.
    You would pass the samples of the waveform that fall between your particular window, then pass 1/number of samples for the d(t) parameter.
    Hope that helps.
    Wendy L
    LabWindows/CVI Developer Newsletter - ni.com/cvinews

  • How can I make the line segment tool repeat several times?

    How can I make the line segment tool repeat several times?

    If this is what you want, hold the ~ key on your keyboard while dragging with the tool.
    If you want spaced copies of the completed line, use the Transform Effects from the Effects menu.

Maybe you are looking for

  • AE and final cut

    I would like to export an edit from final cut to after effects, so that the AE project has a separate layer for each clip in the original edit (or something similar). i'm sure i could do this if i was exporting to motion, or from premier to AE, but i

  • Sunlit Earth (but shaped like a GLOBE) widget -  Does it exist?

    I've seen a couple of really pretty "Sunlit Earth" widgets, but my issue with 'em is that they flatten out the earth-map. Cool, especially now that we're approaching an equinox... But what I'd really love to use on my dashboard is a widget that shows

  • Need info reg char set differences.

    Hi, In my database our Cognos people are using UTFA char set. And other people are using WE8ISO885981 char set. Is there any prob to have two character sets in the database. If yes what are those and how to rectify them. If there is any problem while

  • Custom B2B apps in VPP $9.99 minimum price per app/user instance or just entire purchase?

    For custom B2B apps purchased under the VPP, is the $9.99 minimum the price per installed app instance (i.e. per user) or per app developed? In other words, does a customer with 100 users buying just a single app from me pay at least $9.99 or at leas

  • Release procedure for PR quantity change

    Hi... I have set a release procedure for PR. when i try to change the PR system does not allow me to change the QUANTITY. where to i set the changeblity indicator so that for a specified percentage system will retain the same release strategy.