* You should do it in a single SQL statement if at all possible.
* If you cannot do it in a single SQL Statement, then do it in PL/SQL.
* If you cannot do it in PL/SQL, try a Java Stored Procedure.
* If you cannot do it in Java, do it in a C external procedure.
* If you cannot do it in a C external routine, you might want to seriously think about why it is you need to do it…
think in sets… learn all there is to learn about SQL…
Analytics rock and roll -> http://asktom.oracle.com/pls/ask/search?p_string=Analytics+rock+and+roll