in reply to DBI and variable numbers of bind parameters

Your first way won't work. Use the way davidrw suggested, and use prepare_cached. It will give you an advantage if you call the query multiple times.
  • Comment on Re: DBI and variable numbers of bind parameters