home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 697 of 2,288   
   Jaime Stuardo to All   
   How to load a TABLE fuilly in memory and   
   20 Nov 03 20:13:49   
   
   From: jstuardo@softhome.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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca