Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2009
    Location
    New Delhi - India
    Posts
    22

    Post Unanswered: Updating millions of records

    I need to update the serial no field in a table containing millions of records.
    Can anyone suggest an optimized method. I am doing it in a loop but this takes a lot of time....

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I am doing it in a loop but this takes a lot of time...
    Do not use LOOP; just use UPDATE.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    What is the update that you are doing?
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Mar 2009
    Location
    New Delhi - India
    Posts
    22
    I am shuffling the customer name which is of type varchar2 along with the customer serial no.

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    I am responding to your post.
    Congratulations!
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  6. #6
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Still not enough information!!!!! show us your update loop. How can we help if you dont show us what needs to be done!!
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  7. #7
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    doing row by row is a recipe for slow by slow results.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  8. #8
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    It appears that simple
    Code:
    UPDATE your_table SET
      serial_no = customer_name *shuffled with* serial_no;
    could do the job. What this "shuffled with" means, I wouldn't know. Concatenation? Something different? If so, what?

  9. #9
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    51
    Quote Originally Posted by manik019
    I need to update the serial no field in a table containing millions of records.
    Can anyone suggest an optimized method. I am doing it in a loop but this takes a lot of time....

    please post table DDL and your DML
    Mohammad Hasan Shaharear
    E-mail
    Blog: http://shaharear.blogspot.com

Posting Permissions

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