Oracle insert problem(records not in the order they are inserted)

hi, all:
I tried to insert a word list into a oracle table, everything is fine except that the words are not in the order they are inserted. For example, the words are inserted in the following sequence:
accreted     
accreting     
accretion     
accretionary     
accretive     
bladebone
bladed     
bladeless
bladelike
When I retrived the resultset from the table and iterate through each of the record, the words are not in the order inserted, i.e., it may look like this,
accreted     
accreting     
bladebone
bladed     
accretion     
accretionary     
accretive     
bladeless
bladelike
This strange phenomenon won't happen when the word list is small, like 500 words or so, but when the number of words reaches around 10,000, it takes place. My coworker also experienced this problem when trying to insert large volume of data into oracle table.
The code I used to insert into the DB table:
BufferedReader reader=new BufferedReader(new FileReader("C:\\Dictionary.txt"));
while( (line=reader.readLine())!=null )
     sql="INSERT INTO DICT " +
     "VALUES ('" + line +"')";                         
     statement.executeUpdate(sql);
Any advice will be highly appreciated,
thanks

Well, the best thing to do is follows scsi-boy's advice and add the additional column and either put a sequence number in it from the Java side as you insert, or use an Oracle sequence object to put a sequence number in it from the Oracle side (which is sort of like an auto-generated value, but different).
Note that an Oracle sequence generates numbers in sequence, but possibly with gaps (usually if the database is rebooted), unless you do some things that slow sequences down substantially. Sequences can also be something of a bottleneck on RAC clusters. See:
http://www.dizwell.com/oracle/articles/autonumbering.html
However, if your coworker is commiting after each and every insert (which is bad form and slows the database down, -10 points), and if your coworker is also never ever ever updating the columns after they've been inserted, and if your coworker is using Oracle 10g and not some older version such as 9i, then your coworker could use the ORA_ROWSCN pseudo-column to order by. Those are very very severe constraints and you shouldn't begin to consider doing it that way without a very good reason, and right now you and your coworker wouldn't know a good reason if it snuck up and bit you on the butt, you've got a lot of learning the basics first.

Similar Messages

  • I'm on a windows laptop using iTunes sharing through the family to connect with Apple TV. After choosing the folder of photos to be shared and displayed on the appletv and when I choose to show on screen, they are not shown in the order they are in the or

    I'm on a windows laptop using iTunes sharing through the family to connect with Apple TV.
    After choosing the folder of photos to be shared and displayed on the appletv and when I choose to show on screen, they are not shown in the order they are in the original folder.
    How to pair show in a certain order, for example, sorted by name.
    grateful
    Julio Cesar

    Not that I'm aware of. You just export JPEG copies to a folder that you can point iTunes to. For instance, I have created a folder in my Pictures folder called Apple TV. And within that folder I have other folders of pictures that I can choose from in iTunes to share with Apple TV. But there doesn't seem to be any way to share a Lightroom slideshow. If you have laid to create a video file that would probably work. Apple TV is a little clunky in my opinion. Some things are a little more difficult to do now than they were a while back. I probably haven't provided you with much help, but just keep experimenting and I think you will figure it out.

  • Present instances in the order they are called

    I created this template for teachers to create assessment items. When they click the Add Question Set button, they get a set of buttons for each type of  question. Right now, regardless of what order they click the buttons, the instances of the question subforms show up in the order they are laid out in the designer, and all the questions of one type stay together. I need the question types to appear in the order the buttons are clicked. How do I do this? I have attached my form.
    Thanks!

    This makes sense to me; unfortunately, it's not working. I've tried a few different ways.
    I set the inclusive subform to hidden and then used this script on the button to show just the particular subform I wanted:
    xfa.form.assessment.Questions.Questionset._Questiondetail.addInstance(1);
    xfa.form.assessment.Questions.Questionset.Questiondetail.MCdetail.presence="visible";
    I set the inclusive subform to visible and all the internal subforms to invisible and used the same script:
    xfa.form.assessment.Questions.Questionset._Questiondetail.addInstance(1);
    xfa.form.assessment.Questions.Questionset.Questiondetail.MCdetail.presence="visible";
    I set everything to visible and then used this script to try to hide the ones I don't want to see:
    xfa.form.assessment.Questions.Questionset._Questiondetail.addInstance(1);
    xfa.form.assessment.Questions.Questionset.Questiondetail.MSdetail.presence="invisible";
    xfa.form.assessment.Questions.Questionset.Questiondetail.Matchingdetail.presence="invisibl e";
    xfa.form.assessment.Questions.Questionset.Questiondetail.SAdetail.presence="invisible";
    xfa.form.assessment.Questions.Questionset.Questiondetail.TFdetail.presence="invisible";
    xfa.form.assessment.Questions.Questionset.Questiondetail.orderingdetail.presence="invisibl e";
    xfa.form.assessment.Questions.Questionset.Questiondetail.FIBdetail.presence="invisible";
    Then I realized what the problem is. I can't set the inclusive subform (xfa.form.assessment.Questions.Questionset.Questiondetail) to "positioned". It needs to be "flowed" because the subforms within it for each question type have to be able to expand. As long as it's not "positioned" I can't call instances of it, right? Is there a way around this?

  • How can I transfer photos in an iphoto album to a usb in the order they are in the album?

    I just got a digital photo frame and want to transfer pictures from an iPhoto album in the order they are in the album. When I try and move them to a usb or card they are rearranged according to the number of the photo. How can I transfer them in the order they should be for an album or slide show?

    Here's one (of several) way(s) to do what you want:
    Make an Album of the photos, then drag the pics into your preferred order.
    Then Photos Menu: Batch Change -> Set Title to Text "John's Birthday", for instance, and tick the box to append a number to each Photo. Now your photos are titled 'John's Birthday 001, John's Birthday 002 ... etc'
    Then File -> Export and in the Export dialogue set the Filename to "Use Title"
    Sort on Filename in the FInder and you end up with a folder full of images in the same order as the Album in iPhoto.

  • I have an iMac running Mavericks 10.9.4 I also have about 30 Kodack photo CDs that I wish to convert from PCD to Jpeg but Mavericks will not see the files, they are grey.  Is there any way to convert them?

    I have an iMac running Mavericks 10.9.4 I also have about 30 Kodack photo CDs that I wish to convert from PCD to Jpeg but Mavericks will not see the files, they are grey.  Is there any way to convert them or must I do it on another machine?
    Kaibil

    iPhoto used to support the PCD format up to a few years ago. It's extremely frustrating that Apple decided to no longer support this format and now I'm directed to pay nearly $40 for an app that will (GraphicConverter 9). Did Lemke Software make a deal with Apple so we'd have to pay a premium for a very overpriced converter? And, how are decisions like this supposed to encourage the use of iPhoto?
    Apple users already pay a premium to use a Mac. Obstacles like these eventually destroy loyalty to the Apple brand. Just ask Microsoft how their back room deals that exploited their customer base worked out for them.

  • Re emailing photos from iPhoto: after I create an event, I later add captions, each one beginning with a number. I'd like to email a set of these photos in the order they are captioned, not the original order of the event.  How do I do this?

    I take a number of photos of an event which I download into iPhoto as an Event.  I later add captions to some of the photos in the Event, and I want to share them by email IN THE ORDER OF THE CAPTIONS RATHER THAN IN THE ORDER THEY APPEAR IN THE EVENT.  Each caption begins with a unique number followed by text.  How can I email them in the order of the caption numbers?

    You can't, block capitals notwithstanding. Try using numbered Filenames. But remember how it's all received at the other end is entirely based on the settings on the recipients machine, so it might well be moot.

  • How can I get playlists to play songs in the order they are listed?

    They always seem to play at random/

    Why does it absolutely have to display albums by the order they were released?  It can do what the programers want it to do.
    You can sort by album, but then by multiple clicks on the album column header you can get album by artist and album by year.

  • Since the latest update to OX I have been unable to download the contents of some emails because pages does not support the font they are created in. Is there a fix for this?

    Hi, since I installed the latest update on my Mac I have been unable to open the contents of some emails because it is saying that pages does not recognise the font. For example it is saying 'some features aren't supported, the font Calibri isn't available on OS X. It was replaced with TrebuchetMS' This means that I cannot open letters from my daughters school. Is there any way round this other than getting rid of this nightmare MAC and going back to Windows!?

    http://www.mozilla.com/en-US/firefox/3.6.13/releasenotes/
    Had the same problem; would have been nice if they had told s that we need an intel processor on our older Macs! I am up and running again.

  • Does PSE13 download photos in the order they are taken on that date and show actual time when hovering over the photo as it did in PSE6?

    In my work, I need to be able to look at photos I took throughout the day at various locations and group them by the time I was there on that date to distinguish the different properties I am taking photos of.  In my previous version of PSE6, when the day's pictures were downloaded, they were downloaded to the computer in the order I took them, and if you hovered over the picture it would show the time the photo was taken.  I just need a program that will organize in that fashion.  I do not need a lot of editing options, more the organizational options.

    Hi,
    If you are happy with PSE 6, why not continue to use it?
    PSE 13 can display the images in date/time order like PSE 6 does. The time doesn't appear when you hover over a thumbnail but can be displayed below the thumbnail. The best thing is for you to download the trial version (select version 13 from the following link) and try it for 30 days to see if you like it.
    Download Photoshop Elements products | 13, 12, 11, 10
    If you use the trial, to see the date and time under each thumbnail you need to go to the View menu in the organizer and ensure that Details is checked.
    Brian

  • ICal events are displayed in the local time zone, not at the time they are supposed to be

    When I enter events in iCal (or in my iPhone calendar), they always display at the time for the zone that I am currently in, even when they occur in a different time zone. For example, if I have a lunch scheduled at 12 pm Monday in Vancouver, I want to see that I have something scheduled at 12 pm on Monday, even if I am in Hong Kong. But even if I have time zone support enabled, the event appears at 4 am Tuesday. This makes it hard to look at the calendar and know what events I have scheduled for what times when I am doing a lot of travel. Is there anyway that I can get the event to show up at 12 pm on Monday no matter where I am in the world?
    Thanks

    This means you're still using Flex 1.5 as your runtime. SAP has introduced Flex 2 RT on SP14 patch 1 onwards. There were a lot of bug fixes and also several new functionality introduced there. I suggest you consider upgrading to the latest SP. Note that you can upgrade VC apart from the portal (only 3 SCAs to deploy) so this means you don't impact the portal itself and continue to have an up-to-date version of VC.
    If you want to solve your problem, I suggest you open a support ticket at SAP and once they see this, they'll let you have those SCAs.
    Regards,
    Natty

  • How can you get your photos in the order they are in your computer

    How can you get your photos synced to your phone in the same order as the file on your computer?

    The iPhone Photos app orders photos by date.

  • Is there a way to export playlists in the order they are in album list view rather than song list view?

    I'd like to have my playlists sorted by Album by Artist/Year when exporting, but I can't figure out how to do it.

    It should be:
    Sort the playlist as Album by Artist\Year
    Right-click on playlist name and click Copy to Play Order
    Export playlist.
    tt2

  • All my photos are importing out of order. For example, if I have images 1,2,3, and 4.., the order they show up in is 2,1,4,3. What could cause this and any ideas how I fix it?

    All my photos are importing out of order. For example, if I have images 1,2,3, and 4.., the order they show up in is 2,1,4,3. What could cause this and any ideas how I fix it?

    One thing, don;t think of them as being imported in any one particular order.
    The order of the images is completely fluid, you can change it anytime you want to suit your needs at that particular moment.
    As Léonie showed you select the order you want to see the images in by selecting the item you want to sort on in the pull-down.
    The only time fluid sort order can be a problem is when you export groups of images. If you put the images into a particular order in Aperture when you export them and view them in the Finder the order they are in may very well be different. In this case you could give names to the images that include a sequence number or index.
    Then when they are viewd in the Finder they will be in them same order they were in in Aperture.
    regards

  • When showing iPhoto library pictures using apple tv the pictures display in a random/scrambled manner rather than in order they are in in the event or album i try to show.  How do i get them to show in proper order?

    when displaying pictures through apple tv the pictures come up in a scrambled or random order rather than in the order they are in my iphoto event or album.  how do i fix this

    You haven't had any bites in a couple of days so you might want to pose your question in the Apple TV forum also. 
    OT

  • Could not download the ordered file after five attaempts due to network problem

    Hi,
    Could not download the ordered file after five attaempts due to network problem.
    Help required.
    Regards,
    Nilesh Shah.

    http://prodesigntools.com/tag/ddl
    http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html
    Mylenium

Maybe you are looking for

  • Help, no sound, no sound output devices

    Hi all, I tried this over in the Tiger section with little help. About a week ago I told my grand-daughter she could plug her iPod headphones into the headphone jack on the the front of the G4. Now, I have no sound at all except for through the headp

  • Issue while opening Shop Link in New Window

    Hi All, Recently We have upgraded SRM5.0 to 7.0 and now we are using Portal for Front end application. We have configure the SRM appliation in Portal EP 7.0. Now i can fetch the data from SRM but problem is when i am opening Shop Link ( Employee Self

  • Adobe Reader 9 automatically converts to Word

    When I try to open a file in Adobe Reader 9 it automatically converts to Word (just a list of code). How can I prevent this?

  • Increase in email spam lately

    I would say in the last week, we have seen an increase in random spam coming through our IronPort C160.  We are on async version 7.6.0-444.  It seems in the message logs quite a few get out there with random.  My boss just got 3 pieces of spam mail i

  • Proxy Authorizations

    Hi Experts We are migrating from XI 3.0 to PI 7.1 and R3 4.7 to ECC 6.0. I need to regenerate ABAP proxies on ECC6.0 to enable communication with PI. The both Regenerate and Activate buttons are both disabled. What authorizations i will need to get t