A pretty simple mantra when it comes to developing database software:
1. You should do it in a single SQL statement if at all possible.
我们应该尽量使用单个SQL语句来实现应用需求;
2. If you cannot do it in a single SQL Statement, then do it in PL/SQL.
如果单个SQL无法实现,考虑使用PL/SQL来实现;
3. If you cannot do it in PL/SQL, try a Java Stored Procedure.
如果PL/SQL无法实现,接下来可以尝试使用Java存储过程来实现;
4. If you cannot do it in Java, do it in a C external procedure.
如果Java过程也不行,尝试使用C的外部存储过程来解决;
5. 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...
如果以上都不能实现,那么你应该认真考虑你为什么要实现这个需求...[@more@]