Call (800) 766-1884 for Oracle support & training
Free Oracle Tips

Oracle Consulting Support
Oracle Upgrades
Use New Oracle Features
Oracle Replication Support
Oracle Training
Remote Oracle DBA
System Documentation
Oracle Tips
Oracle Performance

Free Oracle Tips



BC Oracle tuning

Oracle training

Oracle support

Remote Oracle




Oracle Pseudocode for Annual_Review() Procedure
Oracle Tips by Burleson

After determining how each individual requirement can be met, we can write some pseudocode that puts the logic for the procedure together. This allows us to clarify our thoughts about the procedure and to put those same thoughts into a form that can be looked over by someone who is more familiar with the business rules.

Listing 4.27 shows the pseudocode for the Annual_Review() procedure.

Listing 4.27 Pseudocode for the Annual_Review() procedure.

open a cursor of all employees;
for each employee loop
  determine how often the employee has been on time;
  if the employee is on time more than 98% then
     grant a .5% raise;
     if the employee has no late days then
       grant another .1% raise;
     end if;
  end if;
  if the employee has four or more warnings then
     skip this employee -- no raise;
  end if;
  if performance rating is higher than 8 then
     grant a .5% raise;
  end if;
  calculate the new salary;
  update the base_salary column in the EMPLOYEES table;
end loop;
commit changes;
if any errors occur then
end if;

This pseudocode seems like it will do the trick, but looking at it a little more closely, we notice that we’re checking the warnings after doing some other things. Because warnings can disqualify the employee from getting a raise, the procedure will work a bit more quickly if no work is done until after the warnings are checked. Figure 4.2 illustrates the logical execution of the procedure.

Figure 4.2  The logical execution of the Annual_Review() procedure.

This is an excerpt from the book "High Performance Oracle Database Automation" by Jonathan Ingram and Donald K. Burleson, Series Editor.


Oracle performance tuning software 

Oracle performance tuning book


Oracle performance Tuning 10g reference poster
Oracle training in Linux commands
Oracle training Excel
Oracle training & performance tuning books



Copyright © 1996 -  2014 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation. 

Hit Counter