in reply to Re^2: Using DBI to extract from 2 databases
in thread Using DBI to extract from 2 databases

It's hardly this disaster you liken it to. With the advice given and a few minutes the existing code could be made less messy. Most DB issues would be caught by enabling RaiseError, advice has been given (in a previous thread also) on place holders, redundant variables would identified and easily resolved.

With this out of the way OP can concentrate on the bigger issues which have been highlighted by resolving these trivial problems. Hopefully the exercise of cleaning this up would help with learning why such things are important, and how to think about approaching problems like this in future.

Replies are listed 'Best First'.
Re^4: Using DBI to extract from 2 databases
by space_monk (Chaplain) on Apr 24, 2013 at 15:58 UTC

    Yes, I know - I gave an answer to try and resolve most of the issues below. My "titanic" response was just me succumbing to the Dark Side... :-)

    If any of my proposed solutions have minor errors, it's because I don't waste my genius on trivial matters. :-P