DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: way cant i use "rownum" as the normal sencr advice

  1. #1
    Join Date
    Apr 2006
    Location
    israel
    Posts
    1

    way cant i use "rownum" as the normal sencr advice

    i have got 10 tables that i had to populate by insert as select from
    the same table using a DB LINK:

    all tables where huge (the largest wat 2.6 GIGA) and the insert failed on UNABLE TO EXTEND ROLLBACK SEG ....

    i whanted to use rownum splite every inserting into smaller ones so after every one of the il do commit...
    (i didnt want to use the colums name in order to write somthing general for future use)
    when i tryed to use rownum beteen 1000000 and 2000000
    now rows was selected (although the tabkes got 6000000 rows in it)
    way that happen?

    what can i use in order to write an inseret as select command
    that will commit every fow rows?


    thank,
    Guy

  2. #2
    Join Date
    Mar 2006
    Posts
    40
    Write a PL/SQL procedure that uses a cusror to select from the original table and while going trhough the cursor insert into the target one while commiting on a desired number of rows.
    go to the oracle clinic
    Quick and easy Oracle database support and consulting

  3. #3
    Join Date
    Mar 2006
    Posts
    40
    BTW you cannot use rownum as it is just a pseudo column which value is generated when the results from the query are listed so this is now actual value of the row in a table. In cases such this you can just use the primary key or some other columns that differentiate each row independently.
    go to the oracle clinic
    Quick and easy Oracle database support and consulting

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092

  5. #5
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    How about skipping that whole inconvenient rolback thing with a nologging direct path insert?
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width