in reply to DBI debugging: SQL dumping?

Given that you're using place holders, the SQL itself shouldn't change, so if it works once it should "always" work, as long as the parameters that you're passing in are valid.

So you could try just dumping the parameters, and seeing what doesn't look right.

Alternatively, if you want more, try using tracing, available through DBI. See the tracing section in DBI.