Hi all...
I have a table that will never change. Specifically it's a mortality chart
that I need to use to make some calculations. One column of the table is the
age of the person, and other column is the factor to apply to the
calculation.
Suppose the calculation need to be made for 5000 people. It's inadmissible
to make 5000 SELECT's to get the factor for each person. That calculation
isn't done for only one group of persons, but for a lot of groups. So the
solution is to place all that data in memory, in ascending order, so that
the age will be the index to that memory table and the factor will be the
data stored in that memory location.
I want to be able to do something like this
VALUE := 0;
FOR I IN 1..NUM_PERSON LOOP
VALUE := VALUE + TABLE_IN_MEMORY( AGE( I ) ) * SOME_OTHER_NUMBER;
END LOOP;
Is it clear what the problem is? Any help will be greatly appreciated
Thanks a lot in advance
Jaime