Get record by recno

I want to get record by record number using cursor. I use btree, which is configured to support recno (pdb->set_flags(DB_RECNUM);
I found how to get recno by record and it work:
unsigned int Recno()
  db_recno_t recno;
  Dbt numValue;
  memset(&numValue, 0, sizeof(numValue));
  numValue.set_data(&recno);
  numValue.set_ulen(sizeof(recno));
  numValue.set_flags(DB_DBT_USERMEM);
  //int ret = bdbCursor->c_get(bdbCursor, Key, &data, DB_GET_RECNO)) != 0
  bdbCursor->get(&Key, &numValue, DB_GET_RECNO);
  return (unsigned int)recno;
I trying to do same to get record by recno, but BD just crached and no show error message.
bool MoveToRecno(db_recno_t recno)
  memset(&Key, 0, sizeof(Key));
  Key.set_data(&recno);
  Key.set_size(sizeof(recno));
  Key.set_flags(DB_DBT_USERMEM);
  int ret = bdbCursor->get(&Key, &Value, DB_SET_RECNO);  //program crached here
  return ret == 0;

Found bug: answer will be written to usermem:
  unsigned char * buff = new unsigned char[100];
  memset(&Key, 0, sizeof(Key));
  memcpy(buff, &recno, sizeof(recno));
  Key.set_data(&buff);
  Key.set_ulen(100);
  Key.set_size(sizeof(db_recno_t));
  Key.set_flags(DB_DBT_USERMEM);
  int ret = bdbCursor->get(&Key, &Value, DB_SET_RECNO);

Similar Messages

  • My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    Do you have a backup of your iPhone which contains these messages?
    If so, you can restore a new iPhone from that backup during setup.
    If not, the messages are gone.

  • How to get record control in sony ericsson p1i.

    How to get record control in sony ericsson p1i....
    does jsr234 helps??

    I'm not sure it is possible to get the PL/SQL record type through JDBC. Please try to access this procedure through JDBC to see if it is possible.
    You may need to convert the record type, to an object-type, i.e. wrap the procedure in another procedure that converts the record type. You could also just wrap the procedure in another that expands the record values into individual output parameters.

  • How can i get records of all text messages

    How do you get records of all your texts? Everyone tells me to go to text usage for my number but it does not show up. Any ideas? I need them like now

        Hey there Amanda_x,
    I've heard your cry for help and I am here to assist. Are you looking just for the numbers that you've texted and received texts from? Or are you looking for the actual text message conversation?
    If you are just looking for the numbers that you've texted and received texts from you can retreive that information through My Verizon. Once you are signed in as the account owner you would click on "view my usage" under Manage My Account. From there you can click on Breakdown of Recent Activity and from there you can view the messaging log for your line.
    If you are looking for previous text messages that may have been deleted. That cannot be retreived through My Verizon.
    Verizon Wireless is only able to provide an average of the last 3-5 days of content, but never more than ten days from the date and time the message is delivered.  Only messages that are received may be available. We also must receive a message with your consent and have it notarized and submitted by an attorney or law enforcement official.  You can have those documents faxed to (847) 706-7276.
    Let me know if you have any additional questions.
    NicholasB_VZW
    Follow us on Twitter @VZWSupport

  • How can I get record count with a query?

    In Client/Server pplication,the client send a query to server.
    How can server get record count by oracle call interface?
    Is it need execute "select count(*) from ...."?

    Yes.
    Either that or increment a counter for each record fetched and
    loop round until you hit the last record.
    The first method would be more efficient on large datasets.

  • Query  for getting records  max  reported  timestamp and 2nd max report

    query for getting records in between
    max reported timestamp and 2nd max reported timestamp
    HERE IS ALL RESULT SET
    TIME DOMAIN
    30:jun:2006:20:08:45 TOMCAT
    30:jun:2006:20:08:45 TOMCAT
    30:jun:2006:20:07:04 TOMCAT
    30:jun:2006:20:07:04 TOMCAT
    30:jun:2006:20:07:24 TOMCAT
    30:jun:2006:20:07:24 TOMCAT
    30:jun:2006:20:07:45 TOMCAT
    30:jun:2006:20:07:45 TOMCAT
    30:jun:2006:20:08:05 TOMCAT
    30:jun:2006:20:07:04 TOMCAT
    30:jun:2006:20:08:05 TOMCAT
    PD_REPORTED_TIMESTAM PD_USER
    30:jun:2006:20:08:25 TOMCAT
    30:jun:2006:20:08:25 TOMCAT
    30:jun:2006:20:08:45 TOMCAT
    30:jun:2006:20:08:45 TOMCAT
    30:jun:2006:20:07:24 TOMCAT
    30:jun:2006:20:07:04 TOMCAT
    30:jun:2006:20:07:24 TOMCAT
    30:jun:2006:20:07:45 TOMCAT
    30:jun:2006:20:07:45 TOMCAT
    30:jun:2006:20:08:05 TOMCAT
    30:jun:2006:20:08:05 TOMCAT
    PD_REPORTED_TIMESTAM PD_USER
    30:jun:2006:20:08:25 TOMCAT
    30:jun:2006:20:08:25 TOMCAT
    QUERY RESULT TO COME
    TIME DOMAIN
    TOMCAT 30:jun:2006:20:08:45
    TOMCAT 30:jun:2006:20:08:45
    TOMCAT 30:jun:2006:20:08:45
    TOMCAT 30:jun:2006:20:08:45
    Message was edited by:
    user517983

    Hi,
    can we write query like this.
    1 select pd_user,PD_REPORTED_TIMESTAMP
    2 from sp_process_detail_current spdc
    3 where host_id='DSCP02469'and pd_user='TOMCAT'
    4 and exists(
    5 select PD_REPORTED_TIMESTAMP from sp_process_detail_current
    6* having max(PD_REPORTED_TIMESTAMP)-spdc.PD_REPORTED_TIMESTAMP=0)
    SQL> /
    PD_USER PD_REPORTED_TIMESTAM
    TOMCAT 30:jun:2006:20:08:45
    TOMCAT 30:jun:2006:20:08:45
    TOMCAT 30:jun:2006:20:08:45
    TOMCAT 30:jun:2006:20:08:45

  • ABAP - HR : Need macro or FM to get record based on changed on date (AEDTM)

    Hi,
    I am having the requirement to get record which changed on yesterday (for sy-datum - 1). That means if record is updated today, by using rp_provide_from_last I will get today's record. But i should get yesterdays record.
    we can get this by using select or loop or provide - endprovide. Taking performance issue in consideration, this statements are not allowed.
    So please provide me any macro or function module which we can retrive the record based on AEDTM.
    I am using PNPCE LDB and i need to extract data for PA infotypes.
    Thanks in Advance,
    Ravi Kumar

    Hi Ravi,
    There is no macro which can retrieve the record based on AEDTM. One more thing to say is statement provide ...endprovide statement can be used and there would be no performance issue if i am not wrong. Anyway try this code.
    tables: pa0001, pernr.
    infotypes : 0001.
    data : begin of itab occurs 0,
           pernr like pa0001-pernr,
           aedtm like pa0001-aedtm,
           end of itab.
    data : v_aedtm type pa0001-aedtm.
    start-of-selection.
    v_aedtm = sy-datum - 1.
    get pernr.
    provide * from p0001 between pn-begda and pn-endda.
    if p0001-aedtm = v_aedtm.
    move : p0001-pernr to itab-pernr,
           p0001-aedtm to itab-aedtm.
           append itab.
    endif.
    endprovide.
    end-of-selection.
    loop at itab.
    write :/ itab-pernr, itab-aedtm.
    endloop.
    Regards,
    Kranthi

  • Vocals getting recorded at more rate so out of rythm

    Hi I need help my vocals get recorded at more speed than I actually sing at so getting out of rythm.
    Please help
    Its not a latency issue it is the other way round .

    You seam to be focusing your anger at Verizon and not your sister. Verizon followed the rules and required IDs and passwords to access the wireless account. You and/or your mother are supposed to safeguard that information.  Your sister has committed the felony by stealing your mothers identity for personal gain.
    You say "I am very dissatisfied with how VZW is handling an illegal and fraudulent change on my account that has shafted me out of 500 dollars.'  My question to you is who made the illegal and fraudulent change to your account?  Verizon or your sister? Keeping in mind your sister had all the correct IDs and passwords,
    I'm sure if you went to Verizon and wanted to make some changes to your account, and you had the correct IDs and passwords, you would be upset and angry if they put you through the 3rd degree because they thought you were committing fraud.
    Good luck to you, (seriously) whatever happens,

  • How can one record live and simulatoneously show what is getting recorded?

    hello friends
    how can one record live video and simulatoneously show what is getting recorded?
    please help?
    Manmeet

    i have found solutions
    thanks

  • Screen icon flashes not getting recorded

    Hi folks-
    I'm documenting how to use an ESRI ArcMap "computerized map"
    application. I'm making a Captivate demo of a few screen actions.
    When I go into record mode I do get the pull-downs and data entry
    actions in my demo, but one of the things I do makes an icon flash
    within the recording window. This "flash" doesn't get recorded -
    the end result does get recorded, but not the intermediary
    flashing.
    Is there any way to configure Captivate to capture things
    that flash on the screen? User input (such as moving a mouse) gets
    properly recorded.
    Thanks...
    Charlie

    Welcome to our community, xiney1
    You may wish to force Full Motion recording by tapping the F9
    key before you know the flash will occur. Then tap the F10 key to
    stop Full Motion recording.
    Cheers... Rick

  • To get record of colleague  employee who working in same department in oracle

    to get record of colleague  employee who working in same department in oracle

    Please read the FAQ:
    Re: 2. How do I ask a question on the forums?
    and post sufficient details for people to help you.
    Ensure you post what you've tried yourself and what's not working/error messages.

  • Query to get records between a range...............

    Hi,
    Is there any way in oracle to get records between the records 20-30.
    As far as i know in oracle you can put where rownum < (some integer)
    But is it possible to getsomething between the records 20-30
    Thanks

    Is there any way in oracle to get records between the
    records 20-30.No you can't do it.
    The reason why it's not possible is because oracle has no internal ordering of the records.
    http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    How ROWNUM Works
    ROWNUM is a pseudocolumn (not a real column) that is available in a query. ROWNUM will be assigned the numbers 1, 2, 3, 4, ... N, where N is the number of rows in the set ROWNUM is used with. A ROWNUM value is not assigned permanently to a row (this is a common misconception). A row in a table does not have a number; you cannot ask for row 5 from a table—there is no such thing.

  • Is there any way to get record of all my applecare calls

    I was wondering if there was any way to get record of all my applecare calls/repairs...I am interested in pursuing a replacement of my macbook pro, this will be my 4th repair (2nd in a month) and I have been on the phone with apple about 20-30 times in the past month...any suggestions are appreciated

    You can probably look them up yourself here:
    http://www.apple.com/support/repairstatus/
    If that doesn't work, you can try calling Apple tech support and asking. They should be able to give you a list of case numbers, or calls/repairs on a given case number, for the serial number on your MBP. A Genius at an Apple Store could probably also look them up for you.
    Message was edited by: Dave Sawyer

  • Itunes radio problems - getting recording when I click on station

    Keep getting recording when I click on Itunes Radio stations about not streaming outside the US after Fed 1st.  I'm in LA!  stations then do not play....

    Is the computer set up to use a proxy server?

  • Why the oldest recorded track get recorded again when making new track?

    1. I play my guitar and record it (track1)
    2. I play track1 and recording my vocal
    3. The track1 get recorded again on my vocal track
    How to set off that? So i dont have double sound of the oldest track on the new track

    Kaibe008 wrote:
    3. The track1 get recorded again on my vocal track
    How to set off that?
    use headphones

Maybe you are looking for

  • Acrobat 9 Security issue

    I'm setting up Password Security for editing and printing my PDF which works fine -- But each time I set my compatibility to "Acrobat 6.0 and later" in the Password Security- Settings window, and as soon as I save and reopen the PDF it defaults to "P

  • How to use PrSDKTransmitInvocationSuite in a importer ?

    But other types of plug-ins can use the Transmit Invocation Suite to push frames to transmitters. For example, an effect or titler with a modal setup dialog could push frames to the output. This is good idea for a title importer ! But, how to use "Pr

  • Motion videos render out blurry

    Maybe someone could help me. I've been creating title bars in Motion to use for sermons. I simply place them at the bottom of the screen. Nothing fancy. When I export the file and place it in FCP, for some reason the Motion video seems to be blurry,

  • VendorDataSource

    Ok, the tutorial on multiple database links gave "VendorDataSource" command as part of the code to get things going. Thing is it won't compile, and appears nowhere on the API..... is this normal or am i really missing something. Tutorial fragment bel

  • Palm 4.1 to Palm 6.2.1

    I recently went from an ancient Clie to a Treo 650.  I downloaded the PalmDesktop Software as directed from the Palm website.  I uninstalled the old PalmOS and installed the new Palm 6.2.1.  The website says that the Palm 6.2.1 will fill the desktop