Oh, by the way, this seems fairly typical of code that I've witnessed in the investment banking industry. Biggest bunch of cowboys that ever lived.. God only knows how any of their financial transactions and calculations ever actually produced viable answers - clearly logical thought (such as programming) is way beyond the average investment banker coder..
I think you have found the secret of the present financial crisis. It was brought upon us by crappy SQL-code! LOL
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James