Advertisement

01.19.2006 at 12:54PM PST, ID: 21703124
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

this script took 48 hrs to complete 500k records

Asked by DBA_Frog in Oracle Database

Tags: , ,

this script snippet cause the script to take 48+ hours to complete. The update is only 500K records.

the date data that is being compared is loaded from a prior script. So, I know the date format is correct. Similar scripts like this run in 10 minutes.

What is wrong in this code??
-----------code starts------------------------------------------

begin
   open data_cursor;
   loop
   fetch data_cursor into data_val;
   exit when data_cursor%NOTFOUND;
        update NSF_account_HOUSEHOLD set
      hh_contribution_income = data_val.contribution_income,
      hh_balance = data_val.balance,
      hh_nsf_fees = data_val.nsf_fees,
      hh_nsf_waive_bank_error = data_val.nsf_waive_bank_error,
      hh_nsf_waive_cap = data_val.nsf_waive_cap,
      hh_nsf_waive_other = data_val.nsf_waive_other,
      hh_return = decode(sign(data_val.balance - 100), -1, 0, data_val.contribution_income * 2 /
         data_val.balance) * 100,
      hh_referral_code = decode(data_val.acct_officer_num, 0, 'R', 'O') ||
         decode(sign(months_between(data_val.data_date,data_val.open_date) -5), -1, 'N',
         decode(decode(sign(ceil((decode(sign(NSF_account_HOUSEHOLD.acct_balance-100), -1, 1.5,
         .015 * data_val.balance) - data_val.contribution_income * 2) / 35)), -1, 0,
         ceil((decode(sign(data_val.balance - 100), -1, 1.5, .015 * data_val.balance)
         - data_val.contribution_income * 2) / 35)),0,'0','1')),
      hh_minimum_nsfs = decode(sign(ceil((decode(sign(NSF_account_HOUSEHOLD.acct_balance-100), -1, 9999,
         .015 * data_val.balance) - data_val.contribution_income * 2) / 35)), -1, 0,
         ceil((decode(sign(data_val.balance - 100), -1, 1.5, .015 * data_val.balance)
         - data_val.contribution_income * 2) / 35)),
      hh_first_deposit_open_date = data_val.open_date,
      hh_deposit_tenure=months_between(data_val.data_date,data_val.open_date),
      hh_best_chk_minimum_nsfs=data_val.best_nsfs  
      where NSF_account_HOUSEHOLD.data_date = data_val.data_date
      and NSF_account_HOUSEHOLD.HOUSEHOLD_KEY = data_val.HOUSEHOLD_KEY;
    end loop;

end;
Start Free Trial
 
Loading Advertisement...
 
[+][-]01.19.2006 at 01:07PM PST, ID: 15742896

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle Database
Tags: data_val, records, script
Sign Up Now!
Solution Provided By: ram_0218
Participating Experts: 4
Solution Grade: A
 
 
[+][-]01.19.2006 at 01:31PM PST, ID: 15743167

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.19.2006 at 09:33PM PST, ID: 15746560

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.20.2006 at 02:09AM PST, ID: 15747651

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43