Need help with sorting records in primary and secondary databases

Hi,
I would like to store data into primary and secondary db in different order. For the main primary, I want it to be ordered by login_ts instead of uuid which is the key.
For the user secondary database, I want it to be ordered by sip_user. For the timestampe secondary db, I want it to be ordered by login_ts.
This is what I have right now,
this is for main
uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200003 login_ts=1264327688 logout_ts=
uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200003 login_ts=1264327618 logout_ts=
uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
this is for user search
uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200003 login_ts=1264327688 logout_ts=
uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200003 login_ts=1264327618 logout_ts=
uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
this is for timestamp
uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200003 login_ts=1264327688 logout_ts=
uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200003 login_ts=1264327618 logout_ts=
uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
but what I want is :
this is for main
uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200004 login_ts=1264327618 logout_ts=
uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200005 login_ts=1264327688 logout_ts=
this is for user search
uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200004 login_ts=1264327618 logout_ts=
uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200004 login_ts=1264327688 logout_ts=
this is for timestamp
uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200003 login_ts=1264327618 logout_ts=
uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200004 login_ts=1264327630 logout_ts=
uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200004 login_ts=1264327688 logout_ts=
Right now, I have:
int compare_login_ts(dbp, a, b)
     DB *dbp;
     const DBT a, b;
     int time_a = 0;
     int time_b = 0;
     time_a = atoi ( (char *)a->data);
     time_b = atoi ( (char *)b->data);
     return time_a - time_b ;
for the timestamp secondary, I set that compare function:
          if ((ret = (*sdb)->set_bt_compare(*sdb , compare_login_ts )) != 0){
Does anyone know how can I make it sorted according?

Hi,
The DB->set_bt_compare() is used to compare keys in Btree database. In the callback function, both the DBTs are key, but not data. Please refer to http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/dbset_bt_compare.html.
If you want any field in the data to be sorted, you might create a secondary index on it and define the compare function as you wish.
Regards,
Emily Fu, Oracle Berkeley DB

Similar Messages

  • Need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook.......

    need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook? removal of cmos, resetting laptop, using cccleaner, windows password recovery and hiren's was noneffective, any help is appreciated. thanks

    Hi,
    As your notebook is a business class machine, security is more stringent - the password is stored in non-volatile memory and there are no 'backdoor' passwords.  Your best option would be to contact HP regarding this.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Setting up a primary and secondary Database in Oracle 10G

    Hi Experts
    can you please tel me the steps involved in creation of primary and secondary database? This is the first time i am going to configure this setup. Please provide your helping hands.
    Thanks alot in advance,
    Ram

    Absolutely glad to help.
    Step 1: Clarify what it is you are trying to build. Are you talking about a Standby Database? Perhaps Physical or Logical Data Guard? If so what protection mode? Stand-alone or RAC? Or are you just trying to dup an existing database on another server in which case you can just use RMAN.
    Step 2: Go to http://tahiti.oracle.com and read the relevant docs
    Step 3: Go to http://metalink.oracle.com and look at the Knowledge Base docs
    If you have any question thereafter contact us and be sure to include your version number, not a marketing label. 10g is a marketing label that refers to everything from the 10.1 Beta through 10.2.0.4.

  • Need Help with DVD recorder (HDMI) to record off DVR

    I purchased a philips dvd recorder a few years ago and need  help in setting up to record my DVR program recordings. The philips user manual is not very helpful being I'm trying to set-up with just using HDMI cables.  I have a HDTV (Vizio) with a HDMI port; a DVD recorder with HDMI port and my Verizon set-top box have a HDMI port.  How do i get it all to work and be able to record/copy programs from DVR to my DVD recorder?   Do anyone have suggestions on how to set up wiring.  Thanks.
    Solved!
    Go to Solution.

    First keep in mind that DVD is not an HD format, so you will not be able to record HD shows in HD; they will be in letterboxed 4:3.
    The FiOS STB only has one HDMI (out) port. Therefore, you will need to use some other output from the STB to the DVD recorder. Component, or even composite/RCA, because it's not going to record in HD anyway to DVD, will work just fine. Then you want to set your DVD player to whatever input you used to connect from the STB; i.e. mine uses "Input 1" for my composite connection.
    If you turn on your STB and DVD, this will record whatever the STB is outputting to a DVD if you press record on the DVD recorder. This includes all of the program menus and any other on-screen graphics on the STB, and this means you cannot change the channel if you are recording from your STB. You can shut your TV off, but you will not be able to watch another show while recording one to DVD.
    Your DVD player might give you an HDCP message at first when the recording starts if it's getting an HD input, but that should go away after a few seconds, at least for my Panasonic DVD recorder with a composite connection.

  • Need help with Go Pro Hero 3 and Premiere Pro CS6

    Hello,
    I recently acquired PP CS6. I put my clip (30 seconds long) and I go to preview while editing, for the first 1.5 seconds it is fine but then it is very choppy. The audio is fine but the video does not play smoothly. When I save and process the video it is fine. It is frustrating to try to edit video this way. I'm sure I'm missing a step when creating the project but I haven't used Premiere Pro since CS6. This is only happening with Go Pro Hero 3 videos, any of my other cameras are fine. Any ideas? Thanks

    There's a lot of confusion over how video encoding affects subsequent editing performance - a higher data rate has no direct relation to how much effort is required to decode and play the footage, in fact a higher data rate often makes playback easier - which is why transcoding to AVI can help with playback even though the files can be hundreds of times larger. Data rates with the same codec depend on the frame contents and recording quality, but for playback and editing what matters is the GOP (group-of-pictures) structure and the complexity of the encoding algorithm. Provided your disks are fast enough the data rate is immaterial to Premiere.
    With long-GOP files (as typically created by consumer DSLRs and helmet cams) we have keyframes (I-frames) with a complete set of pixel data, then a series of intervening P- and B-frames which only store the difference between 'now' and 'one frame before' or 'one frame after'. Unless you're on an I-frame you have to calculate the chain of differences from the nearest I-frame, and when editing or applying an effect we must  re-calculate the entire GOP, so Premiere has to hold a lot of data in the buffer. Remember all timelines in Premiere are internally transcoded to 32-bit floating point, so it's more work to 'play' the footage in the monitors than would be done by a simple playback-only application such as VLC, or in some other brands of NLE that only work in the footage's color space. Premiere's hardware acceleration (MPE) only kicks in once the buffer has been ingested, all the decoding of the original H.264 frames happens in your CPU.
    With digital cinema cameras and some hacked DSLRs, we record "all-I" footage - so there's no GOP overhead and playback/editing is massively smoother. I can scrub all-I footage from a hacked 7D no problem on my relatively-ancient spare laptop, but the  long-GOP files from a factory 7D struggle to play at all. Our all-I 7D footage can hit 300MBit/s compared to 35 for long-GOP. Helmet cams such as the GoPro do all they possibly can to squeeze data onto their storage cards, which means they have long-GOP codecs that have some of the most complicated compression algorithms out there. The Hero3's implementation of H.264 uses the Ambarella chip, whose files are very small but an utter nightmare to decode - hence far more of a demand on your CPU than an equivalent clip from a DSLR.
    Jim Simon wrote:
    Might be the 35 Mbps that is causing the choppy playback.
    It shouldn't, assuming sufficient hardware.  My GH2 clips often get up to over 90 Mb/s and play just fine on an older i7 920.

  • HT4061 I need help with my I-phone 4S and the Cloud,  I can't locate my serial number  I also have a new 4g I-Pad  Can someone help me

    I need help to locate my pictures in the cloud
    When my son updated my phone early this year it wiped out all my pictues on my I-phone 4S
    How do I access the cloud to view my pictures??

    Do you have Photo Stream enabled with your iCloud account on your computer?
    iCloud is temporary storage - limited to 1,000 photos and 30 days for each photo.
    Photos/videos in your iPhone's Camera Roll can and should be imported by your computer as with any other digital camera especially before installing an iOS update.

  • Need help with Color Profiles between Photoshop and iPhoto

    Hey guys, I'm a photographer and have always used Photoshop in comination with iPhoto. I am having great difficulty lately with color profiles randomly changing within albums of pictures. I need all of my images to be in sRGB, but some somehow end up in Adobe RGB. It seems to happen at random. Apple seems to think it's an Adobe problem. Adobe isn't sure what to do. Anybody aware of any known issues between CS5 and iPhoto using OS 10.8.4 with regard to color profiles and how to fix them?

    SRiegel schrieb:
    I don't know inkscape, but this article seems to indicate that is will support cmyk.
    The article also says you need Scribus to then further process the SVG file.
    @shaunamm You need to open the SVGin Illustrator, not place it. But I doubt that you will be able to get the effects in Illustrator.

  • I need help with changing my payment info and I have to accounts I want to delete one can u please help

    I need help trying to change my payment info I can't but I have to accounts and I want to delete one please help me

    We can't help.  We're not Apple.  Contact the iTunes store support.  There's a link on the bottom of every page of the iTunes store

  • Need help with sort

    I need to do an iterate thru records and then allow end user to sort by clicking on table cell header ex.
    name employeenumber dept social sec are the headers. a search is performed and brings back employee name, etc and fills a table cell. the column headers are clicked and results are displayed based on that header. I need to build a way to iterate (which I have) but need to sort also. any suggestions?

    If you're using SQL to pull back your data I would recommend passing an "orderBy" flag when you click on the column heading. Then in your Java code that calls your SQL you can set the "Order By" value to a field name and your data will come back sorted. This would be my first suggestion.
    If this doesn't work for you, take a look at the java.util.Comparator interface.
    Hope this helps!
    DesQuite

  • Need help with ORACLE ADMIN, NETWORKING CONCEPTS and SQL, ASAP!

    Hey everyone. Basically my major is going to be computer science, however I haven't started the course yet. However I got a job offering to the position as a SEO. A friend told me as long as I can answer the questions, the job will be no problem, I mainly just google oracle commands to put in all day. So I'm really needing someone who knows about this stuff, that could help me with some of these questions. If you can help, and have the time, my skype ID is drakkarnc
    I greatly appreciate this, thank you. :)

    841784 wrote:
    Hey everyone. Basically my major is going to be computer science, however I haven't started the course yet. However I got a job offering to the position as a SEO. What is "SEO"?
    A friend told me as long as I can answer the questions, the job will be no problem, I mainly just google oracle commands to put in all day. So I'm really needing someone who knows about this stuff, that could help me with some of these questions. If you can help, and have the time, my skype ID is drakkarnc
    I greatly appreciate this, thank you. :)YOu think you can learn this stuff in a few days? Think again.
    Re: What to learn first for DBA/DEV?

  • Need help with Low disk space issue and blue screen

    Hi Everyone, just seen a message stating a low disk space on my Mac pro bought last November and tried plugging in an external hard drive to remove some pictures to free up some space but it seems that the computer did not have enough space left to start up and run the hard drive. I then tried to restart and ended up with a blue screen and have no knowledge now how to fix this problem. I phoned support but they say I have no technical support left but do have warranty and I would need to either try with the community here or take the unit to an apple store for an appointment. The store is an 1 and 1/2 from me and I really want o see if there is another fix that could allow me to start again then remove some files and then add external drive to remove more. I was blown away at the low amount of storage.....looked for the icloud option last night to upload there as i was told about this by a UK client of mine and now see it is not up and running. Any advice or help by the communtiy would be greatly appreciated as this is my business and travelling laptop. Cheers, Dean <")))><

    Great to hear Dean, thanks!
    Further notes: OSX needs about 15% or 10GB Free space minimum, but will run mucch faster/safer with 30-40% or 50GB of Free Space... Free Space is no longer ours to use.
    Another tool to help clear up assorted things is Applejack...
    http://www.macupdate.com/info.php/id/15667/applejack
    After installing, reboot holding down CMD+s, (+s), then when the DOS like prompt shows, type in...
    applejack AUTO
    Then let it do all 6 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 6 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    Trash old Log files.
    First reboot will be slower, sometimes 2 or 3 restarts will be required for full benefit... my guess is files relying upon other files relying upon other files! :-)
    Disconnect the USB cable from any Uninterruptible Power Supply so the system doesn't shut down in the middle of the process.

  • Need help with choosing a 6 cell and 9 cell battery (mo06, mo09)

    Hey hi all,
    I have a pavilion m6 series notebook which comes with mo06(6 cell) battery by default.
    I need to replace the battery with a new one and I've come across a mo09 (9 cell) battery with the same price as that of mo06.
    I've no idea if mo09 batteries can be used instead of mo06.
    If anyone who knows anything about this please help me choose.
    Here's the link
    http://hpshopping.in/Accessories/Batteries
    Thanks a lot in advance

    Hi
    Sorry was the delay wanted to make sure the battery should work fine for your unit.
    672412-001  SPS-BATT 9C 100WHr 3.0AH LI MO09100-CL  
    Let us know how it goes!
    "I work for HP."
    ****Click the (purple thumbs up icon in the lower right corner of a post) to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    Regards
    Manjunath

  • Need help with total hard drive replacement and reinstall

    Hello everyone, let me first say thank you for all the help I hope I get. I have a HP Envy 14 1260se Beats Edition Laptop and I recently purchased a new SSD which really made my laptop speedy. The only problem I am having is that I purchased the recovery disks from HP so I could get all the drivers and everything restored but it does not work at all. So I used a windows 7 professional iso disk my friend had and installed windows (64 bit) and everything works perfectly, but I am missing the volume controls that show up on the screen. Usually when I press volume up or down using the keys on my keyboard it would show a bar in the middle of the screen telling me where my volume is. Now I just see the little volume icon in the taskbar which is just a little annoyance. Also I no longer have the beats on off button working. Is there a way I can download these little things to make my laptop almost the same as it was out of the box without all the bloatware? Any help would be appreciated and sorry in advance if this is confusing. 
    This question was solved.
    View Solution.

    Hi:
    I don't know about the Beats audio thing but I think you need the HP OSD utility to get the volume control to show up on the screen.
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-106851-1&cc=us&dlc=en&lc=en
    Did you install the quick launch software?
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-97078-1&cc=us&dlc=en&lc=en&...=
    The probable reason the recovery disks didn't work is your SSD was of a smaller capacity than the mechanical HDD the notebook originally came with.
    They won't work normally on any hard drive that is smaller than the one the PC came with.

  • Need Help with Sound Recording

    Hi,
    I'm a Comp. Sys. Eng. student in my final year and I've been trying to record sound with java for a couple of months now and its driving me stupid. I've looked around on just about every java source site I could find and have found many similar examples of sound recording, none seem to work on my machine. The problem is that I keep on getting either IOExceptions, or empty .wav files (as in the code below). The code included below is a shortened and modified version of some code I got from jsresources.org, the full link is http://www.jsresources.org/examples/AudioCommon.java.html.
    I have not had any experience with multimedia in java before.
    Can somebody please tell me what is wrong with this code? or is my java environment to blame?
    Am I declaring my AudioFormat correctly?
    Am I controlling my AudioInputStream correctly?
    I'm using JDK1.4 in eclipse. Any help would be greatly appreciated.
    * AudioCommon.java
    * This file is part of jsresources.org
    * Copyright (c) 1999 - 2001 by Matthias Pfisterer
    * All rights reserved.
    import java.io.File;
    import java.io.IOException;
    import javax.sound.sampled.AudioFileFormat;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.DataLine;
    import javax.sound.sampled.Line;
    import javax.sound.sampled.LineUnavailableException;
    import javax.sound.sampled.Mixer;
    import javax.sound.sampled.SourceDataLine;
    import javax.sound.sampled.TargetDataLine;
    public class AudioCommon
         private static boolean          DEBUG = true;
         public static void main(String Args[]){
              AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
    44100.0F, 16, 2, 4, 44100.0F, false);
              TargetDataLine dataLine = getTargetDataLine("AK5370 ",
                        audioFormat,
                        5);
              File     outputFile = new File("C:\\testRecorder.wav");
              try{
                   outputFile.createNewFile();
              } catch(IOException ioe){
                   System.err.println("Couldn't create a new file: " + ioe);
              AudioFileFormat.Type     targetType = AudioFileFormat.Type.WAVE;
              SimpleAudioRecorder     recorder = new SimpleAudioRecorder(
                        dataLine,
                        targetType,
                        outputFile);
              out("Press ENTER to start the recording.");
              try
                   System.in.read();
              catch (IOException e)
                   e.printStackTrace();
              recorder.start();
              out("Recording...");
              long millis = System.currentTimeMillis();
              while(System.currentTimeMillis() < millis + 5000);
              recorder.stopRecording();
              out("Recording stopped.");
              if(outputFile.exists()){
                   System.out.println("File Exists.");
              } else {
                   System.err.println("File does not Exist.");
              System.exit(0);
         public static TargetDataLine getTargetDataLine(String strMixerName,
                                       AudioFormat audioFormat,
                                       int nBufferSize)
                   Asking for a line is a rather tricky thing.
                   We have to construct an Info object that specifies
                   the desired properties for the line.
                   First, we have to say which kind of line we want. The
                   possibilities are: SourceDataLine (for playback), Clip
                   (for repeated playback)     and TargetDataLine (for
                   recording).
                   Here, we want to do normal capture, so we ask for
                   a TargetDataLine.
                   Then, we have to pass an AudioFormat object, so that
                   the Line knows which format the data passed to it
                   will have.
                   Furthermore, we can give Java Sound a hint about how
                   big the internal buffer for the line should be. This
                   isn't used here, signaling that we
                   don't care about the exact size. Java Sound will use
                   some default value for the buffer size.
              TargetDataLine     targetDataLine = null;
              DataLine.Info     info = new DataLine.Info(TargetDataLine.class,
                                       audioFormat, nBufferSize);
              try
                   if (strMixerName != null)
                        Mixer.Info     mixerInfo = getMixerInfo(strMixerName);
                        if (mixerInfo == null)
                             out("AudioCommon.getTargetDataLine(): mixer not found: " + strMixerName);
                             return null;
                        Mixer     mixer = AudioSystem.getMixer(mixerInfo);
                        targetDataLine = (TargetDataLine) mixer.getLine(info);
                   else
                        if (DEBUG) { out("AudioCommon.getTargetDataLine(): using default mixer"); }
                        targetDataLine = (TargetDataLine) AudioSystem.getLine(info);
                   *     The line is there, but it is not yet ready to
                   *     receive audio data. We have to open the line.
                   if (DEBUG) { out("AudioCommon.getTargetDataLine(): opening line..."); }
                   targetDataLine.open(audioFormat, nBufferSize);
                   if (DEBUG) { out("AudioCommon.getTargetDataLine(): opened line"); }
              catch (LineUnavailableException e)
                   if (DEBUG) { e.printStackTrace(); }
              catch (Exception e)
                   if (DEBUG) { e.printStackTrace(); }
                   if (DEBUG) { out("AudioCommon.getTargetDataLine(): returning line: " + targetDataLine); }
              return targetDataLine;
    EOF<<<<<<<<<<<<<<<<import java.io.File;
    import javax.sound.sampled.*;
    class SimpleAudioRecorder extends Thread{
         private TargetDataLine          m_line;
         private AudioFileFormat.Type     m_targetType;
         private AudioInputStream     m_audioInputStream;
         private File               m_outputFile;
         public SimpleAudioRecorder(TargetDataLine line,
              AudioFileFormat.Type targetType,
              File file)
         m_line = line;
         m_audioInputStream = new AudioInputStream(line);
         m_targetType = targetType;
         m_outputFile = file;
         public void stopRecording(){
              m_line.stop();
              m_line.flush();
              m_line.close();
    EOF<<<<<<<<<<<<<<<<

    your asking the quest in the jmf forum and using some old type of handling the media
    sun has given you very good frame work which reduce lot of coding and makes the life easy
    then why are you going to old way.
    first go and read jmf tutorial and implement your self dont go to get the code which some other people have written. do your self . you have energy to do. why are depending on others
    read well tutorial and design. you will win i am sure
    jmf makes life easy

  • Need help with Canon Vixia HF S200 and FCP settings looks awful, help!

    Shot footage on Canon Vixia HF S200 HD at PF24 looks great in camera. Used Wondershare video converter to go from .MTS file to MPEG4 file. Brought into FCP 6.0.6 now image has a lag time or slightly blocky/mosaic when people or camera moves; the sound is good. What should my sequence settings be? Did I miss a setting in Wondershare? I've never used this camera before and my boss needs me to impress our new school superintendent...help!
    Andrew

    Thanks Jerry, that helped alot. Read my latest post please:
    ...Pro Res 422 for a 4 minute project using FCP 6.0.6. It's a Mac Pro 2x3Ghz Quad with GB 800 Mhz. The project is almost done but it is freezing up during playback. Plays for 20 second then playhead freezes then jumps ahead. I've copied timeline sequence 2 times and created new sequences and that does not help. If anyone has suggestions I'm all ears, thanks.
    Andrew

Maybe you are looking for