How to load a TABLE fuilly in memory and keep it

From: Jaime Stuardo <jstuardo_at_softhome.net>
Date: Thu, 20 Nov 2003 20:13:49 -0300
Message-ID: <3fbd472e_1_at_nova.entelchile.net>


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 Received on Fri Nov 21 2003 - 00:13:49 CET

Original text of this message