PL/SQL (MOSC)

MOSC Banner

Optimize Query

edited Mar 5, 2012 8:16AM in PL/SQL (MOSC) 9 commentsAnswered
Dear ALL!


CREATE OR REPLACE Procedure TotalIncome ( name_in IN varchar2 ) IS total_val number(6);

cursor c1 is select monthly_income

from employees

where name = name_in;

BEGIN

total_val := 0;

FOR employee_rec in c1 LOOP

total_val := total_val + employee_rec.monthly_income;

END LOOP;

END;

-----------------------

Question # 1 – Re-write the above procedure. Please optimize it for speed and execution.

Question #2 – Describe how to embed test data inside the production schema+database instance.

                      What are the pros and cons on this approach?

                      If you have done this in the past, describe the problem you were trying to solve and whether it was successful.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center