in reply to Is there a way to display the statement generated by DBD on execute()
I would take a hard look at your logic on this. Your method will not scale. For example what do you do once you get to 20 ids or 50 ids?
In Section
Seekers of Perl Wisdom